CS 230 Fall 20046                              Assignment 12 – Parallel Arrays                                                   100 points

Assigned: 11/29/2006

Due: 12/08/2006 at the start of class.   

 

Pre-Lab (Do Before Lab):  Bring a new disk. Plan out tasks, objects, and events needed for program. Plan out major pseudocode

 

Main Assignment:

E-Vote Inc is revising their program to cash in on the electronic voting era.  Your program (though still simplified) has a major improvement over your previous version – you can see a summary of results – with number of votes for each candidate and displaying the winner. Your program still only deals with voting for one office. The program should get from a file (voters.txt) a list of voter Ids and voter names, and display them in a list box.  The program should also get from another file (candidates.txt) a list of candidates and put them in an array of candidates, as well as a list box or combo box. There should also be a parallel array with the number of votes received (which should start out as zero!!! J ). When the user selects a voter  from the voter list box, their info should be displayed in read-only text boxes or in labels. When a user then selects the candidate from the combo box (or list box) AND selects a “Vote” button, acknowledge the vote, write the vote (voterId, name and candidate selected) to a comma-delimited text file for later auditing (add it to those already in the file), update the number of votes received for the appropriate candidate and remove the voter from the list box of eligible voters.  Do NOT allow somebody to vote if they have not BOTH signed in AND picked a candidate. (DO NOT have the vote recorded immediately upon selection in the combo box in case of an inadvertent click). Provide the vote capability, a summary results capability and an exit capability.

 

Hand in:

 

Task Details

 

Miscellaneous:

·         MAKE SURE YOUR PROGRAM WORKS!

·         Put YOUR NAME, e-mail address, date, and purpose of the program in comments at the beginning of the program.

·         You MUST include comments that explain your program in order to get full credit.

·         Remember to use meaningful variable names, and indent to show the structure of the program (VB usually does this correctly).

·         Put your name on the form as a Label or as part of the form title.

·         Try to use good user interface design. Make clear what user needs to do and what the answers mean.