Past-paper question · 2016 October-November · Paper 22 · Q1(c)

Question 1(c) 2016 · October-November · Paper 22 · 3 marks

Original past-paper question for 1(C)
Original past-paper question for 1(C)
Original past-paper question for 1(C)
Original past-paper question for 1(C)
Original past-paper question for 1(C)
Reveal official mark-scheme answer Official mark-scheme answer for 1(C)

Official answer for Question 1

Part (c)

Part (c)

INPUT PlayerGameGrade

✓
WHILE NOT(PlayerGameGrade = 'A' OR
✓
PlayerGameGrade = 'B' OR
✓
PlayerGameGrade = 'C' OR
✓
PlayerGameGrade = 'D')
✓
OUTPUT "Invalid – Re-enter"
✓
INPUT PlayerGameGrade
✓
ENDWHILE
✓
One mark for each of:
✓
•
✓
WHILE ... ENDWHILE
✓
•
✓
Correct condition in a loop
✓
•
✓
INPUT within loop plus one before loop // alternative arrangement leading to
✓
correct exit from loop
[3]

Mark scheme 9608_w16_ms_22.pdf →

Show text version of question

Question 1

Part (c)

Question 1

A number of players take part in a competition. The competition consists of a number of games.

Each game is between two players. The outcome of a game is that each player is awarded a grade (A, B, C or D). Each grade has an associated number of points as shown in the table below.

Grade Points

A
0
B
1
C
3
D
5

The points total for all players is recorded. After each game is completed, the total number of points for each player is updated.

For example:

  • before the game between Ryan and Karina, Ryan’s total is 5 points and Karina’s total is 3 points
  • the result of the game between Ryan and Karina is: Ryan achieved grade B, Karina achieved
  • grade D

  • the players’ points totals are updated to: Ryan has 6 and Karina has 8

When a player’s points total reaches 12 or higher, that player is removed from the competition.

A
programmer will write a program to update the player total after a game.

The program will output:

  • the player’s updated points total
  • the message ‘ELIMINATED’ if the player is removed from the competition.

The programmer designs the identifier table below:

Identifier Data type Description PlayerName STRING Name of the player PlayerGameGrade CHAR Game grade for the player PointsTotal INTEGER Current player points Procedure has parameters SavePlayerTotal procedure PlayerName and PointsTotal and saves the updated player total Function has a parameter ReadPlayerTotal function PlayerName and returns the current total for that player

Part (c)

The programmer amends the design to validate the value of player game grade that the user

inputs.

The amended part of the flowchart is shown below.

Loop

OUPUT INPUT "Invalid – Re-enter" PlayerGameGrade

Is No PlayerGameGrade = 'A' or 'B' or 'C' or 'D'?

Yes

Question 5

Write the equivalent pseudocode using a pre-condition loop, for this part of the amended flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

..............................................................................................................................................

[3]
Topic relevance

Why this question appears here

71% assigned-topic match · Algorithm design and problem-solving › Algorithms

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_w16_qp_22.pdf

Keep practising this topic