Computer Science · Oct / Nov 2020 · Paper 21 · Question 1
0478
As printed in the paper
The question as text
All variables, constants and other identifiers must have meaningful names.
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
1(a)[3]
For one array
One mark for naming of an array with a suitable data type and one mark for its use
Array
yearsWithoutClaim
Data type integer
Use
to store the % discount
Many correct answers, this is an example only.
1(b)[4]
For each validation check
One mark for identification of a check and one mark for the reason max 4 Check
presence check
Reason need to enter age to calculate price
Check
type check
Reason need to check age is a positive integer
Many correct answers, these are examples only.
1(c)[6]
Any six from:
MP1 Input with prompt if new customer
MP2 Check age greater than or equal 26
MP3 Check age less than or equal 70
MP4 Check number of years without a claim greater than or equal to 2 … MP5 … discount 10%
MP6 Otherwise discount 0%
MP7 Calculate new price and value of extra discount
MP8 Output new price and value of extra discount, with suitable message Sample answer
PRINT "Are you a new customer Y/N?"
INPUT new
discount ← 0
IF new = "Y" DO
IF age >= 26 AND age <= 70
THEN
IF yearsWithoutClaim >=2
THEN
discount ← price * 0.1
price ← price * 0.9
ENDIF
ENDIF
PRINT "New price", price
PRINT "Extra discount for new customer", discount ENDIF
1(d)(i)[4]
Explanation
Any four from:
MP1 Provide a prompt and input to check if additional driver required MP2 Check response with IF/REPEAT/WHILE/CASE statement for yes MP3 … input age of additional driver
MP4 … Use of IF / REPEAT etc. to validate age
MP5 … use the age input to find / look up appropriate price increase MP6 … description of how the price to pay now is calculated
MP7 … description of how the price to pay now is displayed including the use of a suitable message
For no
MP8 … no output required or suitable message output
Programming statements can be used but must be explained.
1(d)(ii)[3]
Description
Any three from:
MP1 Use a variable (quotes) to keep a running total of the number of quotes provided
MP2 Ask, using prompt with input, customers if they are going to purchase the insurance
MP3 Use another variable (policies) to keep a running total of the number of insurances bought / not bought
MP4 Use these to calculate the percentage policies/quotes*100
Section B
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

