Question 5(d) 2018 · May-June · Paper 22 · 10 marks
Reveal official mark-scheme answer
Official answer for Question 5
Part (d)
Question 1
Show text version of question
Question 5
Part (d)
Question 5
A golf club holds information about its members. When a member completes a round of golf, their
score is stored along with their membership number and the date of the round.
is formed into a string as follows:
<MembershipNumber><Date><Score>
Part (d)
The program designer decides to store the strings from part
Part (a)
in a text file,
ScoreDetails.txt
Each string is formatted as follows:
<MembershipNumber><Date><Score>
- MembershipNumber is a four-digit numeric string between "1111" and "9999".
- Date is a six-digit numeric string in the format DDMMYY, for example "040716".
- Score is a two-digit numeric string in the range "50" to "99".
member.
Assume that there is at least one string stored for each member.
The program needs a procedure, OutputLowestScore(), to process the ScoreDetails.txt file and output the lowest score for an individual member.
1. Use the GetNumber() function to obtain a valid membership number. 2. Search the ScoreDetails.txt file for the lowest score for that member. 3. Output a message giving the lowest score for that member and the date of the round. For example: "The lowest score was 66 on 300917"
Write program code for the OutputLowestScore() procedure.
Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type.
Programming language ............................................................................................................
Program code
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Question 13
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................
Question 14
Why this question appears here
72% assigned-topic match · Hardware › Logic gates and logic circuits
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_s18_qp_22.pdf
