Question 4(b)(ii) 2014 · May-June · Paper 23 · 32 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (b)
(ii)
(ii)
Puzzle[1,3] 5
Show text version of question
Question 4
Part (b)
(ii)
Question 4
Question 5
2 Sheena wants to set up a business selling home-made cakes. She wants customers to order online. She needs to know:
- customer’s name
- customer’s contact telephone number
- the date the cake is to be ready
- the type of cake
- whether the cake is to be delivered or not.
o fruit cake o victoria sponge o gateau o cheesecake
Sheena wants to store the data for each order as a record consisting of the following fields:
- CustomerName
- TelephoneNumber
- DateReady
- CakeType (F, V, G or C)
- Price ($)
- ToBeDelivered
(ii)
Using a high-level programming language, declare a record structure for the fields
defined in part (b)(i).
Language
Code
Question 7
Question 3 begins on page 8.
Question 8
3 Raza wants to write a number-guessing game. He has drawn a flowchart of an algorithm:
START
MyNumber RANDOM(100)
The algorithm uses EndGame
- the built-in function RANDOM(x) which
- the variables
FALSE returns a random integer in the range 1 to x.
Initialise NumberOfGuesses ○ EndGame ○ Guess ○ MyNumber Output ○ NumberofGuesses “Guess my number Type 0 (zero) to end game”
Input Guess
Is Guess = 0 No Increment ? NumberOfGuesses
Yes
Output Is Guess = No Is Guess > No “You gave up after” MyNumber ? MyNumber ? NumberOfGuesses Yes Yes
Output Output Output “Correct - you took” “Too high - “Too low - NumberOfGuesses try again” try again” “to guess my number”
EndGame TRUE EndGame TRUE
No Is EndGame TRUE?
Yes
END
Question 9
In a high-level language write programming statements to implement the algorithm.
Language
Code
Question 10
4 A puzzle starts with a partially completed grid of digits. A player must fill a 9×9 grid with single digits so that each column, each row, and each of the nine 3×3 sub-grids contain all of the digits from 1 to 9.
Each puzzle has a unique solution. Below is an example of a puzzle and its solution:
PUZZLE SOLUTION
Raul wants to write a program that displays the puzzle and allows the user to enter digits to attempt a solution.
Part (a)
Describe the type of interface needed so that the user can enter digits on screen.
Part (b)
The program needs to store the puzzle.
(i)
Describe the data structure required.
(ii)
Using the data structure you described in part (b)(i), give the pseudocode assignment
statement that stores the 5 in the top row of the example shown.
Question 11
Why this question appears here
72% assigned-topic match · Algorithm design and problem-solving › Algorithms
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 9691_s14_qp_23.pdf
