Question 1(b) 2024 · May-June · Paper 42 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 1
Part (b)
Question 1
mark each
Question 4
Show text version of question
Question 1
Part (b)
Question 1
A program outputs a main word. The program asks the user to enter the different words of 3 or
more letters that can be made from the letters in the main word. These are called the answers.
There are 3 files: Easy.txt, Medium.txt and Hard.txt. Each file has the main word on the first line. For example, the main word in Easy.txt is house.
The answers are stored in the file. Each answer is on a new line after the main word. For example, Easy.txt has 14 answers that can be made from the letters in house.
The words read from the text file are stored in the global array WordArray. The number of words that can be made from the letters in the main word is stored in the global variable NumberWords.
Part (b)
The main program asks the user to enter "easy", "medium" or "hard" and calls
ReadWords()with the filename that matches the user’s input. For example, if the user enters "easy", the parameter is "Easy.txt".
Write program code for the main program.
Save your program.
Copy and paste the program code into part 1(b) in the evidence document.
Question 3
Why this question appears here
75% assigned-topic match · Programming › Constructs
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 9618_s24_qp_42.pdf
