Past-paper question · 2021 May-June · Paper 21 · Q1(c)

Question 1(c) 2021 · May-June · Paper 21 · 5 marks

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)

✓
Any five from:

Question 5

✓
MP1
✓
Input with message to enter unique voter number
✓
MP2
✓
Validation of (unique) voter number entered e.g. length check/type check/range check
✓
MP3
✓
Attempt to check if voter number input is in list of possible voters
✓
MP4
✓
Attempt to check if they have already voted
✓
MP5
✓
If voter has already voted, message to warn them they can’t vote
✓
MP6
✓
Attempt at preventing them from voting
✓
MP7
✓
Store voter number in a suitable data structure
✓
Example answer
✓
OUTPUT "Please enter your unique voter number"
✓
INPUT UniqueVoterNumber
✓
FoundFlag ← False
✓
AllNumbersChecked ← False
✓
Counter ← 0
✓
WHILE FoundFlag = False AND AllNumbersChecked = False
✓
IF StudentNumbers[Counter] = ""
✓
THEN
✓
AllNumbersChecked = True
✓
StudentNumbers[Counter] ← UniqueVoterNumber
✓
ELSE
✓
IF UniqueVoterNumber = StudentNumbers[Counter]
✓
THEN
✓
FoundFlag = True
✓
PRINT “Sorry, you have already voted”
✓
ELSE
✓
Counter = Counter + 1
✓
ENDIF
✓
ENDIF
✓
ENDWHILE
✓
IF FoundFlag = False
✓
THEN
✓
OUTPUT "Please enter the code of your chosen candidate"
✓
INPUT Vote
✓
ENDIF
✓
2210/21
✓
Cambridge O Level – Mark Scheme
✓
May/June 2021
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 2210_s21_ms_21.pdf →

Show text version of question

Question 1

Part (c)

Part (c)

Write an algorithm using pseudocode, programming statements or a flowchart to show how

your program completes these parts of Task 2:

  • Allows students to enter their unique voter number before casting their vote.
  • Checks whether the student has already voted:
  • if so, supplies a suitable message and does not allow them to vote.
  • if not, stores the unique voter number, but not their vote, in a suitable data structure.

It is not necessary to show parts completed in Task 1, including counting of votes for each candidate.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Question 5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[5]

Question 6

Topic relevance

Why this question appears here

98% assigned-topic match · Algorithm design and problem-solving

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 2210_s21_qp_21.pdf

Keep practising this topic