Question 4(b)(ii) 2015 · May-June · Paper 22 · 16 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
Question 4
Part (b)
(ii)
Question 4
Terminates the program Ends
Complete the pseudocode for the design in part (b), shown again below, to respond to each menu choice.
CONSTANT i 3 CALL DisplayMenu NoOfAttempts 0 REPEAT OUTPUT "Enter choice (1..4)" INPUT Choice NoOfAttempts NoOfAttempts + 1 UNTIL (Choice >= 1 AND Choice <= 4) OR NoOfAttempts = i
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Question 7
Part (d)
The algorithm in part
Part (c)
is to be amended. The program will:
- repeatedly display the menu and respond to the user’s choice
- terminate when the user enters 4
Write program code for this final design which will be made up of:
- the main program
- procedure ReadFile
- procedure DisplayMenu
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 ............................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[8]
Question 8
3 When the guarantee on a computer runs out, the owner can take out insurance to cover breakdown and repairs.
The price of the insurance is calculated from:
- the model of the computer
- the age of the computer
- the current insurance rates
Following an enquiry to the insurance company, the customer receives a quotation letter with the price of the insurance.
The structure chart below shows the modular design for this process:
....................................
...................... ......................
......... ...................... ...................... ......................
...................... ................. ......................
......................
.................................... .................................... Premium rates
Premium rates
access premium rates database ....................................
Question 9
Using the letters E to J, complete the labelling on the chart opposite.
Some of these letters will be used more than once.
Data items E CustomerName F CustomerEmail G Model H Age I PolicyCharge J PolicyNumber
Question 10
4 A game is played between two players:
- they take turns at rolling a six-sided die (numbered 1 to 6) and record their throw
- a player scores 1 point if their throw is higher than their opponent
- they each roll the die 20 times
- if the player’s throw is the same as their opponent, the total points is unchanged
- the winner is the player with the larger number of points after 20 throws
The pseudocode will use variable NoOfThrows as shown.
Identifier Data type Description NoOfThrows INTEGER Loop control variable
(ii)
Identify the game result which will produce incorrect output.
...................................................................................................................................................
...............................................................................................................................................[1]
Question 11
Question 5 begins on page 12.
Question 12
Why this question appears here
82% assigned-topic match · Programming › Programming basics
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_s15_qp_22.pdf
