/* This is a Java program that uses a loop to read in 5 pairs of scores, where each pair represents the score of a football game between Bowdoin College and some other team. Determine, for each pair of numbers, whether Bowdoin won or lost, and after reading the 5 pairs of values, print out the won/lost/tie record of Bowdoin. In addition, if the record is a perfect 5-0, print out the message "Congratulations on your undefeated season!!!". For example: Enter Bowdoin score: 5 Enter oponent score: 2 [... repeat this 4 more times..] Bowdoin game statistics: wins: 3 loses: 1 ties: 1 Kelsey Killmon csci 101, spring 2006 Modified by Laura Toma */ public class GameStats { public static void main (String args[]) { ReadStream r = new ReadStream(); int bowdoinScore; int opponentScore; int numberWins; int numberLosses; int numberTies; int gameNumber; final int NB_GAMES=5; gameNumber = 1; numberWins = 0; numberLosses = 0; numberTies = 0; //this is the loop that reads in the scores and updates the //variables that keep track of number of wins, losses and ties while (gameNumber <= NB_GAMES) { System.out.println("Game " + gameNumber + ":"); System.out.println("Enter Bowdoin's score:"); bowdoinScore = r.readInt(); r.readLine(); System.out.println("Enter opponent's score:"); opponentScore = r.readInt(); r.readLine(); if (bowdoinScore>opponentScore) numberWins = numberWins +1; if (bowdoinScore