school/lab-9/stupid-teams/WinningTeam.java

28 lines
699 B
Java
Raw Normal View History

2020-11-11 08:47:37 -05:00
import java.util.Scanner;
public class WinningTeam {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Team team = new Team();
String name = scnr.next();
int wins = scnr.nextInt();
int losses = scnr.nextInt();
team.setTeamName(name);
team.setTeamWins(wins);
team.setTeamLosses(losses);
if (team.getWinPercentage() >= 0.5) {
System.out.println("Congratulations, Team " + team.getTeamName() +
" has a winning average!");
}
else {
System.out.println("Team " + team.getTeamName() +
" has a losing average.");
}
}
}