The file scores.txt holds three lines: 40, 15 and 25. A program opens it FOR APPEND, writes the line 20 and closes it. It then opens the file FOR READ, adds every line to Total (which starts at 0) inside a WHILE NOT EOF loop, and outputs Total. What is output?
- APPEND keeps the three old lines and adds 20 as a fourth line.
- The loop reads one line on each pass, so it runs 4 times before EOF returns TRUE.
- Total = 40 + 15 + 25 + 20 = 100.
Answer: 100 (with FOR WRITE instead of FOR APPEND the output would be 20)