Introduction to Programming Practice Assessment One
A program is required to count votes for a school representative. The ballots are issued with four check boxes one for each of the four candidates.
The program implements an online ballot giving each of the candidates a numerical reference (which can be decoded using the following table.)
Candidate Name Reference
Gregory Bush 1
Timothy Blair 2
Margaret Fletcher 3
Abraham Linken 4
Task
No Task
1
The first task is to implement a simple menu driven program allowing staff to collate the ballots this should contain the following elements.
A menu which allows the user to select, one of the following options
o Enter votes at console
o Print votes to screen
o Write votes to file
Functions which implement the functionality of the menu options
o An enterVotes function which allows the user to enter a the personal details and votes of a number of individuals into the system
o A printVotes function which prints the personal details and votes of each of the individuals whose details have been stored
o A writeVotes function which writes the votes to file this is similar to printVotes, votes are written to a file called votes.txt
Evidence of testing
o Test plans and test results along with appropriate screenshots to confirm the results of these tests should be provided.
o Appropriate referencing should be included where applicable
2
The second task is to implement a simple menu driven system which allows staff to interrogate the information stored during collation of the ballots. This should contain the following elements.
A menu which allows the user to select, one of the following options
o Read votes from file
o Print votes to screen
o Calculate the votes cast for each person
o Calculate the average age of those who voted
Functions which implement the functionality of the menu options
o A readVotes function which read the votes from file, votes are read to a file called votes.txt
o A printVotes identical to the function in the above program.
o A calculateVotesCast function. This counts up the votes for each of the candidates and reports the votes cast for each
o A calculateAverageAge function which gives the average age of the individuals who voted.
Evidence of testing
o Test plans and test results along with appropriate screenshots to confirm the results of these tests should be provided.
o Appropriate referencing should be included where applicable
3 Extra functionality in the interrogation system such as;
Minimum and maximum age.
Percent male and female voters.
May be implemented once basic functionality is completed and tested.
Additionally they may seek to include validation of the information input by the user, for example trapping out negative ages.
Grade Characteristics Possible Evidence
Pass
The outcomes indicated in the assessment must be achieved at a satisfactory level. Outcome 1
Students should successfully complete task 1.
Students should provide a working copy of the program demonstrating their ability to identify and correct errors within a structured program
Outcome 2
Students should successfully complete task 1.
Students should provide a copy of their program code demonstrating their ability to implement a solution in a structured programming language.
Merit
In order to achieve a merit the student must in addition to the requirements for a pass include the requirements listed opposite. Outcome 1
Students should successfully complete task 1 and the majority of task 2.
Students should provide a working copy of the program demonstrating their ability to identify and correct errors within a structured program
Outcome 2
Students should successfully complete task 1 and the majority of task 2.
Students should provide a copy of their program code demonstrating their ability to implement a solution in a structured programming language.
Distinction
In order to achieve a distinction the student must in addition to the requirements for a merit provide the requirements listed opposite. Outcome 1
Students should successfully complete tasks 1 & 2 and 3.
Students should provide a working copy of the program demonstrating their ability to identify and correct errors within a structured program
Outcome 2
Students should successfully complete tasks 1 & 2 and 3.
Students should provide a copy of their program code demonstrating their ability to implement a solution in a structured programming language.