1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lena [83]
3 years ago
15

Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWin

s + 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.");}}}
Computers and Technology
1 answer:
lukranit [14]3 years ago
7 0

Answer:

Explanation:

public class Team {

   private String teamName;

   private int teamWins;

   private int teamLosses;

   public String getTeamName() {

       return teamName;

   }

   public void setTeamName(String teamName) {

       this.teamName = teamName;

   }

   public int getTeamWins() {

       return teamWins;

   }

   public void setTeamWins(int teamWins) {

       this.teamWins = teamWins;

   }

   public int getTeamLosses() {

       return teamLosses;

   }

   public void setTeamLosses(int teamLosses) {

       this.teamLosses = teamLosses;

   }

   public double getWinPercentage() {

       return teamWins / (double) (teamWins + teamLosses);

   }

}

You might be interested in
You just recently opened a business that will be selling items on the Internet. You don’ t actually have a physical store that p
Ivanshal [37]

Answer:

Explanation:

Shipping fee is based on the weight of the item purchased

Name of the store- MIMI Electronics

Items sold- Consumer electronics, mobiles phones, laptops, wearable devices, accessories, digital watches etc

Shipping charges-

Weight Shipping fee

0-1 kg $      5.00

1-2 kg $   10.00

2-4 kg $   15.00

4-7 kg $   20.00

7-10 kg $   30.00

10 kg + $   50.00

Shipping fee function

F(x)= 5 for all x [0,1]

F(x)= 10 for all x (1,2]

F(x)= 15 for all x (2,4]

F(x)= 20 for all x (4,7]

F(x)= 30 for all x (7,10]

F(x)= 50 for all x (10,infinity)

shipping charge function is a step function where the steps are mentioned in terms of weight.

Shipping charge could also be determined using a piece wise function where the shipping fee is fixed for each piece and is charged based on number of pieces ordered instead of weight of the order

5 0
3 years ago
Someone help me out eh?
Elodia [21]

Line 4

It should be font-size: 15px

Also there should be curly braces in line 5.

6 0
3 years ago
Read 2 more answers
Provide instance fields for title, month, and year (for example, "Scientific American", "April", 2020). Each of these should be
miskamm [114]

Answer:

Check the explanation

Explanation:

Note : check attached image for output and program and also note that you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Program : **************Magzine.java**********************

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

public class Magzine {

 

//class variable private can not access outside class

private String title;

private String month;

private int year;

 

//parameterized constructor

public Magzine(String title,String month,int year)

{

this.title=title;

this.month=month;

this.year=year;

}

 

//override toString method

"at"Override

public String toString()

{

String detail=title+" "+month+" "+Integer.toString(year);

return detail;//return string of class variable

}

 

//get Magzine objecte

 

public boolean equals(Magzine obj)

{

//commented returm statement compare string by address so you can uncomment if

//we do not use same string object of String class

//return this.month==obj.month && this.title==obj.title && this.year==obj.year;

//compare two object element if matches return true else false

return (this.month.equals(obj.month)) &&(this.title.equals(obj.title)) && this.year==obj.year;

}

   

}

Program : *************************Main.java****************************

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

public class Main {

/**

* "at"param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Magzine Obj =new Magzine("Scientific American ", "April", 2020); //object of class

Magzine Obj1 =new Magzine("Scientific American ", "April", 2020);//Obj and obj1 is same content data

Magzine Obj2 =new Magzine("Scientific American", "June", 2020); //obj and obj1 same but obj2 different

 

System.out.println(Obj.toString()); //print string of obj

System.out.println(Obj1.toString());//print string of obj1

System.out.println(Obj2.toString());//print string of obj2

 

 

System.out.println(Obj.equals(Obj1)); //obj and obj1 equal and return true

System.out.println(Obj.equals(Obj2)); // obj and obj2 not equal so return false

 

 

}

 

}

Output can be seen below:

4 0
3 years ago
What is a scenario where records stored in a computer frequently need to be checked
vazorg [7]

if your in  school and always are getting into trouble the school will always be checking your records


7 0
3 years ago
Read 2 more answers
If the firewall is configured for credential phishing prevention using the "Domain Credential Filter" method, which login will b
ahrayia [7]

Mapping to the IP address of the logged-in user<u>-will detect  a credential theft</u>

<u></u>

Explanation:

In the "Domain Credential Filter" method the firewall matches the username and the password submitted by the user with the corporate user id and password.

In order to match the credentials submitted by the user the firewalls retrieves data from the bloom filter which is further connected  to windows  User-ID credential service add-on.

The firewall also looks in its Mapping Table for the IP address of the logged-in user

3 0
3 years ago
Other questions:
  • HELP PLEASE
    7·2 answers
  • Help me Please?!! I will put you as brainliest.<br>I hope I spelled that right.
    5·2 answers
  • Assume that name has been declared suitably for storing names (like "amy" , "fritz" and "moustafa") write some code that reads a
    5·1 answer
  • PLEASE HELP<br><br><br> i’m doing a internet safety brochure. what is a good hook ?!
    14·1 answer
  • The person responsible for setting goals and schedules, monitoring work, motivating the team, and reporting progress to managers
    7·1 answer
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • Write a 3-4 page paper (500-800 words) about your project that explains your project, the type of conditioning you used, and the
    10·1 answer
  • Cuáles eran las condiciones de vida de las mujeres durante el renacimiento perduran​
    14·1 answer
  • Sami needs to decide how the fonts, colors, and images will look on her new web site. Which will help her pian her design?
    10·1 answer
  • Which file formats have relatively small file size and are therefore the most widely used formats for sharing and
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!