CODE IN JAVA PLEASE, THANK YOU. ***THIS IS THE WINNINGTEAM.JAVA FILE*** import java.util.Scanner; public class WinningTe

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

CODE IN JAVA PLEASE, THANK YOU. ***THIS IS THE WINNINGTEAM.JAVA FILE*** import java.util.Scanner; public class WinningTe

Post by answerhappygod »

CODE IN JAVA PLEASE, THANK YOU.
Code In Java Please Thank You This Is The Winningteam Java File Import Java Util Scanner Public Class Winningte 1
Code In Java Please Thank You This Is The Winningteam Java File Import Java Util Scanner Public Class Winningte 1 (47.69 KiB) Viewed 23 times
***THIS IS THE WINNINGTEAM.JAVA FILE***
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.setName(name);
team.setWins(wins);
team.setLosses(losses);

team.printStanding();
}
}
7.25 LAB: Winning team (classes) Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is: wins / (wins + losses). Note: Use casting to prevent integer division. For class method printStanding(), output the win percentage of the team with two digits after the decimal point and whether the team has a winning or losing average. A team has a winning average if the win percentage is 0.5 or greater. Ex: If the input is: Ravens 13 3 where Ravens is the team's name, 13 is the number of team wins, and 3 is the number of team losses, the output is: Win percentage: 0.81 Congratulations, Team Ravens has a winning average! Ex: If the input is: Angels 80 82 the output is: Win percentage: 0.49 Team Angels has a losing average. 300766.2211204.pazzy7 LAB ACTIVITY 7.25.1: LAB: Winning team (classes) 1 public class Team 2 // TODO: Declare private fields 3 4 5 // TODO: Define mutator methods - 6 7 8 9 // TODO: Define accessor methods - 10 11 12 HAMASOMAGONE Current file: Team.java ▾ name, wins, Losses setName(), setwins (), setLosses () getName(), getwins (), getLosses () 0/10 Load default template...
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply