(a) Write program code that will input the number of candidates in an election, followed by the
preferences shown for the candidates on each ballot paper. For this task, you are to assume
that all the ballot papers are completed correctly.
The preferences shown on the ballot papers are to be stored in a two dimensional array,
similar in form to Fig. 3.2 on page 10.
The code should also count the number of ballot papers entered.
Provide hard copy evidence of your code, which should be fully annotated.
[6]
(b) Write program code that will read each ballot stored in the array created in (a) and count the
total number of first choice votes for each candidate.
The code should then report which of three possibilities has occurred: an absolute majority, a
tie between all candidates, or the need for a recount.
Provide hard copy evidence of your code, which should be fully annotated.
2007-03-10
11:28:35
·
1 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design