public class TeamTestProgram { public static int totalPoints(Team t) { return (t.wins * 2 + t.ties); } public static int gamesPlayed(Team t) { return (t.wins + t.losses + t.ties); } public static void main(String args[]) { Team teamA, teamB; teamA = new Team("Ottawa Senators"); teamB = new Team("Montreal Canadians"); // Simulate the playing of a game in which teamA beats teamB System.out.println(teamA.name + " just beat " + teamB.name); teamA.wins++; teamB.losses++; // Simulate the playing of another game in which they tied System.out.println(teamA.name + " just tied " + teamB.name); teamA.ties++; teamB.ties++; // Now print out some statistics System.out.println(teamA); System.out.println(teamB); System.out.print("The " + teamA.name + " have "); System.out.print(totalPoints(teamA) + " points and played "); System.out.println(gamesPlayed(teamA) + " games."); System.out.print("The " + teamB.name + " have "); System.out.print(totalPoints(teamB) + " points and played "); System.out.println(gamesPlayed(teamB) + " games."); } }