4
Files in Pseudocode Prepared by: Careene McCallum-Rodney

Files in Pseudocode

Embed Size (px)

DESCRIPTION

Files in Pseudocode. Prepared by: Careene McCallum-Rodney. Append to file example. OPEN FILE "loginInfo.txt" in APPEND mode IF "loginInfo.txt" NOT OPEN THEN PRINT "File cannot open“ ELSE FILE WRITE user[c].username, user[c].password ENDIF - PowerPoint PPT Presentation

Citation preview

Page 1: Files in  Pseudocode

Files in Pseudocode

Prepared by:Careene McCallum-Rodney

Page 2: Files in  Pseudocode

OPEN FILE "loginInfo.txt" in APPEND mode IF "loginInfo.txt" NOT OPEN THEN PRINT "File cannot open“ELSE

FILE WRITE user[c].username, user[c].password

ENDIF CLOSE FILE "loginInfo.txt“

Append to file example

Page 3: Files in  Pseudocode

OPEN FILE "loginInfo.txt" in WRITE mode IF "loginInfo.txt" NOT OPEN THEN PRINT "File cannot open“ELSE

FOR c = 0 TO numUsers-1 DO FILE WRITE user[c].username, user[c].password

ENDFORENDIF CLOSE FILE "loginInfo.txt“

Write to file example

Page 4: Files in  Pseudocode

OPEN FILE "loginInfo.txt" in READ mode IF "loginInfo.txt" NOT OPENED THEN PRINT "File cannot open"ELSE FOR c = 0 TO numUsers-1 DO FILE READ user[c].username, user[c].password

ENDFOR ENDIFCLOSE FILE "loginInfo.txt"

Read from file example