Question: Lab 8.1-File Access and Pseudocode Critical Review When a program needs to save data for later use, it writes the data in a file. The

 Lab 8.1-File Access and Pseudocode Critical Review When a program needsto save data for later use, it writes the data in afile. The data can be read from the file at a latertime Three things must happen in order to work with a file.

Lab 8.1-File Access and Pseudocode Critical Review When a program needs to save data for later use, it writes the data in a file. The data can be read from the file at a later time Three things must happen in order to work with a file. 1) Open a file. 2) Process the file. 3) Close the file An internal file must be created for an output file or input file, such as Declare OutputFile myFile //to write out Declare InputFile myFile //to read in A data file must also be created to store the output, such as Open myEile "thedata.txt" New keywords and syntax include the following Open [InternalName EileNamel Write [InternalName] String or Data] Read [InternalNamel Datal Close InternalName] AppendMode /used with Open when need to append Loops are used to process the data in a file. For example For counter = 1 to 5 Display "Enter a number:" Input number Write myFile number End For When reading information from a file and it is unknown how many items there are, use the eof function. For example While NoT eof (myFile) Read myFile number Display number End While

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!