HW5 - MAE 9 Homework#5 Fall 2006 Due on Thursday October 26 before 9:00 pm(a Print a blank line and a message"Homework#5 Vote Counting and a blank

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* MAE 9: Homework #5, Fall 2006 Due on Thursday, October 26, before 9:00 pm (a) Print a blank line and a message "Homework #5: Vote Counting:" and a blank line. (b) Copy "election2005.dat" from the public directory. Each line represents a digitized voting card of a registered voter. The character '1' in the n-th column indicates that the vote was cast for the n-th candidate. The first 11 columns are for the Mayor of San Diego. The column numbers and corresponding names are 1. Donna Frye 2. Shawn A. McMillan 3. Thomas Knapp 4. Ed Kolker 5. Jerry Sanders 6. Steve Francis 7. Myke Shelby 8. Richard Rider 9. Jeremy Ledford 10. Jim Bell 11. Pat Shea Open and read the file, "election2005.dat". Count the total number of voting cards, the total number of invalid votes, and the votes cast for each candidate. Print the results on the terminal screen. Invalid votes are the ballots which chose more than one mayoral candidates. (no vote for the Mayor is a valid vote.)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/22/2008 for the course MAE 9 taught by Professor Lubarda during the Fall '07 term at UCSD.

Page1 / 2

HW5 - MAE 9 Homework#5 Fall 2006 Due on Thursday October 26 before 9:00 pm(a Print a blank line and a message"Homework#5 Vote Counting and a blank

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online