Computational thinking, algorithms and programming June 2025, Question 4 6 marks
An algorithm is written to read numbers from the external text file data.txt
Each number is checked when it is read from the external text file. The number is output to the user if it is not 0.
Complete the algorithm using the OCR Exam Reference Language statements in the box.
Not all statements are used.
data for if
myFile.close() myFile.readLine() input()
myFile.writeLine() open print
temp txt x
myFile =........ ("data.txt")
while NOT myFile.endOfFile()
if int (........) != 0
endif
endwhile
Reveal mark scheme
Identify how casting is used in this algorithm.
Reveal mark scheme