0% found this document useful (0 votes)
33 views2 pages

GR CHECK - Module 9 Exam Style Answers CUP

The document outlines exam-style questions related to programming concepts, including loops, conditionals, and calculations. It provides specific marking guidance for each question, detailing the criteria for awarding marks based on correct implementation of programming logic. The questions focus on tasks such as calculating a check digit, counting positive and negative numbers, and computing an average while handling a rogue value.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

GR CHECK - Module 9 Exam Style Answers CUP

The document outlines exam-style questions related to programming concepts, including loops, conditionals, and calculations. It provides specific marking guidance for each question, detailing the criteria for awarding marks based on correct implementation of programming logic. The questions focus on tasks such as calculating a check digit, counting positive and negative numbers, and computing an average while handling a rogue value.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Module 9

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

© Cambridge University Press 2019


2 Positive  0
Negative  0
REPEAT
INPUT Number
IF Number > 0
THEN
Positive  Positive + 1
ELSE
Negative  Negative + 1
UNTIL Number = 0

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

© Cambridge University Press 2019

You might also like