Computer Science · Oct / Nov 2020 · Paper 22 · 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)(i)[2]
Any meaningful name for an array related to Task 1 – one mark e.g. SysStore
SysPrice
Correct purpose related to Task 1 – one mark e.g.
…to store the system (components) that have been purchased
…to store the (total) price of the system (being purchased)
1(a)(ii)[2]
Any meaningful name for a variable related to Task 2 – one mark e.g. Component
TotalPrice
Correct purpose related to Task 2 - one mark e.g.
… to allow input of a component code
… to store/calculate the running total price of the system
1(a)(iii)[2]
Any meaningful name for a constant related to Task 3 – one mark e.g. Offer5
Offer10
Correct purpose related to Task 3 - one mark e.g.
… to store the one option discount rate
… to store the two-option discount rate
1(b)[2]
Mark as either:
Two distinct different points
OR
One point and an expansion
Example answers:
Real data can be used in calculations directly (which is required of the Price data) (1)
Data can be stored with decimal places (1)
Real numbers can be used in calculations (1) which is not possible with strings (1)
1(c)[6]
Any six from:
MP1
At least one input (case, RAM, HDD)
MP2
All three inputs fully prompted
MP3
An attempt at validation of input
MP4
One complete validation of input with error message
MP5
Finding the price for one chosen item
MP6
Finding the prices of the other two chosen items correctly
MP7
Calculation of price of the chosen items
MP8
…add the basic components cost to the cost of the chosen items MP9
Storage of chosen items
MP10
Output to show chosen items and price of the computer (with appropriate message)
Example answer:
OUTPUT "Which type of Case would you like? Input the Item Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT CaseCode
Count ← 0
WHILE Count<2 DO
IF CaseCode = ComponentCode[Count]
THEN
CaseIndex ← Count
ComponentFlag ← True
Count ← 2
ENDIF
Count ← Count + 1
ENDWHILE
IF ComponentFlag = False
THEN
OUTPUT "Your case Item Code doesn’t exist, please try again"
ENDIF
ENDWHILE
OUTPUT "Which type of RAM would you like? Input the Item Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT RAMCode
Count ← 2
WHILE Count<5 DO
IF RAMCode = ComponentCode[Count]
THEN
RAMIndex ← Count
ComponentFlag ← True
Count ← 5
ENDIF
Count ← Count + 1
ENDWHILE
IF ComponentFlag = False
THEN
OUTPUT "Your RAM Item Code doesn’t exist, please try again"
ENDIF
ENDWHILE
OUTPUT "Which type of Primary Hard Disk Drive would you like? Input the Item Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT PHDDCode
Count ← 5
WHILE Count<8 DO
IF PHDDCode = ComponentCode[Count]
THEN
HDDIndex ← Count
ComponentFlag ← True
Count ← 8
ENDIF
Count ← Count + 1
ENDWHILE
IF ComponentFlag = False
THEN
OUTPUT "Your Primary HDD Item Code doesn’t exist, please try again"
ENDIF
ENDWHILE
TotalPrice ← 200 + ComponentPrice[CaseIndex] +
ComponentPrice[RAMIndex] + ComponentPrice[HDDIndex] OUTPUT "Your computer consists of ",
Description[CaseIndex], " case, ", Description[RAMIndex], " RAM and ", Description[HDDIndex], " Primary Hard Disk Drive."
OUTPUT "The total price of your computer is $", TotalPrice
1(d)[4]
Any four from:
MP1
Explanation of how the number of additional parts is stored MP2
Explanation of counting of additional parts being added to the system MP3
Explanation of determination of additional parts being 1, or more than 1
MP4
Explanation of using the correct percentage discount
MP5
Explanation of calculating the money saved and finding the new price MP6
Explanation of correct output of money saved and new price
1(e)[2]
Any two from:
MP1
Prompt and input to ask buyer how many computers they wish to purchase (at the start) // When the first computer is complete, prompt and input to ask if they would like to purchase another computer MP2
Introduce an appropriate loop structure
MP3
New storage for more than one computer // Enable the ordering of multiple computers of the same specification
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.

