Cards (2)

  • The stages to write data to a file are:
    • open the file for creating / overwriting / appending to a file
    • write the data to a file
  • The states to read data from a file are:
    • open the file for reading data
    • assign a boolean variable to 'false' to indicate the end of the file is not reached
    • while the end of the file is false and the search item is not found:
    • read the data from the file
    • if the data matches what is being searched for, assign the data to variables or output
    • check if the end of the file has been reached and assign the boolean variable to true
    • close file