Election - / * / Election.java / / This file contains a...

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

View Full Document Right Arrow Icon
// *************************************************************** // Election.java // // This file contains a program that tallies the results of // an election. It reads in the number of votes for each of // two candidates in each of several precincts. It determines // the total number of votes received by each candidate, the // percent of votes received by each candidate, the number of // precincts each candidate carries, and the // maximum winning margin in a precinct. // ************************************************************** import java.util.Scanner; public class Election { public static void main (String[] args) { int votesForPolly; // number of votes for Polly in each precinct int votesForErnest; // number of votes for Ernest in each precinct int totalPolly; // running total of votes for Polly int totalErnest; // running total of votes for Ernest int pollyPrecincts; // number of precincts won by Polly int ernestPrecincts; // number of precincts won by Ernest int tiePrecincts;
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 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Page1 / 2

Election - / * / Election.java / / This file contains a...

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