Question 5(b) 2019 · May-June · Paper 22 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 5
Part (b)
Question 6
Show text version of question
Question 5
Part (b)
Question 5
A student is learning about text files. She wants to write a program to count the number of lines in
a file.
Part (b)
A procedure, CountLines(), is being written to count the number of lines in a text file. The
procedure will:
- take a filename as a string parameter
- count the number of lines in the file
- output a single suitable message that includes the total number of lines.
Write pseudocode for the procedure CountLines().
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 12
Why this question appears here
71% assigned-topic match · Programming › Structured programming
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_s19_qp_22.pdf
