Question 6(a) 2019 · October-November · Paper 22 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (a)
Question 6
Show text version of question
Question 6
Part (a)
Question 6
A text file, StudentList.txt, contains a list of information about students in a school.
Each line of the file contains a reference, name and date of birth for one student. All the information is held as strings and separated by the asterisk character ('*') as follows:
<Reference>'*'<Name>'*'<Date Of Birth>
An example of one line from the file is:
"G1234*Aleza Hilton*05062001"
The reference string may be five or eight characters in length and is unique for each student. It is made up of alphabetic and numeric characters only.
school. The array consists of 500 elements of data type STRING. Unused elements contain the empty string "".
only for students who are still attending the school.
The program is to be implemented as several modules. The outline description of three of these is as follows:
Module Outline description
- Read each line from the file StudentList.txt
- Check whether the Reference appears in the
- If the Reference does not appear then write the
- Return the number of lines not copied.
- Search for a given Reference in the array Leavers
- Take two parameters: the name of an array and a
- Count the number of elements that are the same as
array using SearchLeavers() ProcessStudentList()
line to the file UpdatedList.txt
SearchLeavers() • If the Reference is found, return TRUE, otherwise return FALSE
string. CountTimes()
the string. Return the count value.
Question 15
Part (a)
Write program code for the module SearchLeavers(). Declare any additional variables
you use.
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 16
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_w19_qp_22.pdf
