Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util.Scanner; public class Team { / / Private fields private String name; private int wins; private int losses; / / Mutator methods public void
import java.util.Scanner;
public class Team
Private fields
private String name;
private int wins;
private int losses;
Mutator methods
public void setNameString name
this.name name;
public void setWinsint wins
this.wins wins;
public void setLossesint losses
this.losses losses;
Accessor methods
public String getName
return name;
public int getWins
return wins;
public int getLosses
return losses;
Calculate and return the win percentage
public double getWinPercentage
return double wins wins losses;
Print the team's standing
public void printStanding
double winPercentage getWinPercentage;
System.out.printfWin percentage: fn winPercentage;
if winPercentage
System.out.printlnCongratulations Team getName has a winning average";
else
System.out.printlnTeam getName has a losing average.";
public static void mainString args
Scanner scnr new ScannerSystemin;
Team team new Team;
String name scnrnext;
int wins scnrnextInt;
int losses scnrnextInt;
team.setNamename;
team.setWinswins;
team.setLosseslosses;
team.printStanding;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started