Quelpr

CAPE Computer Science Unit 1 · 2014 · Paper 2 · Question 3(b)(i)

A secondary school is doing a survey on students' favourite subjects. Students are asked to vote for any of four choices: Mathematics, English, Spanish, none. If Mathematics, English or Spanish is not the favourite, students vote "none". Assume that on the day of the survey, 100 students are present. Also assume that all votes are valid. Write an algorithm to find and print:

The number of students that voted for EACH of the subjects: Mathematics, English, Spanish.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 3(a)(i)Sequence[2 marks]
  2. 3(a)(ii)Selection[2 marks]
  3. 3(a)(iii)Iteration[2 marks]
  4. 3(b)(ii)The TOTAL number of students that voted for Mathematics, English or Spanish.[5 marks]
  5. 3(c)Write an algorithm that uses iteration to find the sum of all multiples of six and all multiples of seven between 100 and 250 exclusive. Use one variable, for…[9 marks]

More practice: the rest of this paper · more Algorithm Verification and Development questions · all CAPE Computer Science Unit 1 past papers