Note AcademyNote Academy

Computer Science · Oct / Nov 2016 · Paper 23 · Question 1

2210

As printed in the paper

Show the answer and mark scheme
  • 1(a)[8]

    Many correct answers, the identifiers must be meaningful. These are examples only. There are two marks available for each identifier:

    1 mark for suitable name
    1 mark for a suitable data structure, data type and use – MaxVotes, constant, integer, maximum number of votes that can be cast – CandidateName, array, string, name of candidate – NoCandidates, variable, integer, number of candidates – TotalNoCandidateVotes, array, integer, total number of votes cast [8]
  • 1(b)[4]

    Any four from:

    – prompt for input of candidate number – input of candidate number – check for candidate number of 1, 2 or 3 – output ‘invalid vote’ if input not 1, 2, or 3 – otherwise add 1 to appropriate total and … – … output name of candidate voted for [4]

  • 1(c)[6]

    Description (may include reference to programming statements) any six marks from – output total and … – … corresponding candidate name... – description of method for selecting descending order of totals – evidence that the method works – check if highest number of votes is a unique value – if unique output the candidate name and ‘NEW CLASS CAPTAIN’ – otherwise output ‘NO OVERALL WINNER’ [6]

  • 1(d)[2]

    Accept any reasonable suggestion(s), two marks can be awarded for either a suggestion with an accompanying description e.g. – re run the voting (1)

    without the least popular candidate (1)

    or accept two different suggestions e.g. – re run the voting – give the teacher the casting vote. [2]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.