Computers and Technology
Computers and Technology, 10.06.2020 21:57, babyj93

Given main(), define the Team class (in file Team. java). For class method getWinPercentage(), the formula is:teamWins / (teamWins + teamLosses)Note: Use casting to prevent integer division. Ex: If the input is:Ravens133 where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is:Congratulations, Team Ravens has a winning average!If the input is Angels 80 82, the output is:Team Angels has a losing average. Here is class WinningTeam: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.");}}}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 24.06.2019 04:10, kris1920
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
image
Computers and Technology, 24.06.2019 06:30, chloeholt123
For which utilities, if any, does the landlord pay?
Answers: 2
image
Computers and Technology, 24.06.2019 18:20, 12375819
Use a while-end loop in a script file to calculate the sum of the first n terms of the series: summation sign on the top n bottom k=1 : )^k * k^2 +5k)/3^k show the script file and the two results of n = 10 and n = 20.
Answers: 2
Do you know the correct answer?
Given main(), define the Team class (in file Team. java). For class method getWinPercentage(), the f...

Questions in other subjects:

Konu
Mathematics, 21.10.2020 01:01
Konu
Engineering, 21.10.2020 01:01
Konu
English, 21.10.2020 01:01
Konu
Mathematics, 21.10.2020 01:01
Konu
History, 21.10.2020 01:01