//The following three lines are needed to get a number from the keyboard. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Else2 { public static void main(String[] args) { System.out.print("How many electoral votes did Bush get? "); int bush = getInt(); System.out.print("How many electoral votes did Gore get? "); int gore = getInt(); if (bush == gore) { System.out.println("They're tied."); System.out.println("Please inform the House of Representatives"); System.out.println("that the Electoral College is hung."); } else { System.out.println("There's a clear winner."); System.out.println("Thank you, electorate."); } } //The following 16 lines are needed to get a number from the keyboard. private static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); private static int getInt() { try { return Integer.parseInt(reader.readLine()); } catch (IOException e) { System.err.println("Couldn't receive input: " + e.getMessage()); } catch (NumberFormatException e) { System.err.println(e.getMessage() + ", the characters were not a number."); } return 0; } }