GR CHECK - Module 9 Exam Style Answers CUP
GR CHECK - Module 9 Exam Style Answers CUP
Exam-style Questions
1 Weighting 10
Total 0
FOR Count 1 TO 9
INPUT Digit
Value Digit * Weighting
Total Total + Value
Weighting Weighting – 1
Count Count + 1
NEXT Count
Remainder Total MOD 11
CheckDigit 11 – Remainder
IF CheckDigit = 10
THEN
CheckDigit X
ENDIF
Marking guidance:
1 mark for initialising Weighting and Total correctly
1 mark for correct loop structure
1 mark for correct input statement within loop
1 mark for correct assignment to Value within loop
1 mark for correct assignment to Total within loop
1 mark for correct updating of Weighting and Count
1 mark for correct assignment to Remainder
1 mark for correct assignment to CheckDigit
1 mark for correct IF statement structure and correct Boolean expression
Marking guidance:
1 mark for initialising Positive correctly
1 mark for initialising Negative correctly
1 mark for correct REPEAT loop structure and correct Boolean expression
1 mark for correct input statement within the loop
1 mark for correct IF THEN ELSE structure within loop
1 mark for correct Boolean expression
1 mark for correctly incrementing Positive and Negative
3 RogueValue -1
Total 0
Count 0
INPUT Number
WHILE Number <>RogueValue DO
Count Count + 1
Total Total + Number
INPUT Number
ENDWHILE
If Count > 0
THEN
Average Total / Count
OUTPUT Average
ENDIF
Marking guidance:
1 mark for initialising RogueValue
1 mark for initialising Total and Count correctly
1 mark for INPUT statement before loop
1 mark for correct loop structure and correct Boolean expression
1 mark for correct assignments to Count and Total within loop
1 mark for correct input statement as last statement within loop
1 mark for correct IF statement structure and correct Boolean expression
1 mark for correct assignment to Average and output Average