answer.
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
Ivenika
2 months 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:
amid [951]2 months 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 are given an integer N, followed by N lines of input (1 <= N <= 100). Each line of input contains one or several words
oksian1 [950]

Answer:

Python 3 code:

n = int(input())

rev_str = []

for i in range(n):

   s = str(input())

   s.split()

   words = s.split(' ')

   string = []

     

   for word in words:

       string.insert(0, word)

 

   rev_str.append(" ".join(string))

     

   #print(" ".join(string))

for i in range(len(rev_str)):

   print(rev_str[i])

Explanation:

3 0
2 months ago
Which major NIMS Component describes systems and methods that help to ensure that incident personnel and other decision makers h
maria [1035]

Answer:

1.Communication Management

2.Information Management

Explanation:

NIMS has implemented a COMMUNICATION management system to ensure that decision-makers have the appropriate means to communicate their decisions. This system outlines standards for personnel to convey their decisions more effectively and efficiently.

Additionally, NIMS provides a system created to verify whether personnel possess the necessary information to make and communicate decisions, referred to as Information management. Moreover, it includes templates that detail how information should be disseminated while taking into account the confidentiality of the data.

4 0
1 month ago
Read 2 more answers
Given a Scanner reference variable named input that has been associated with an input source consisting of a sequence of strings
8_murik_8 [964]

Answer:

count = 0;

longest =0;

String myString = new String();

while (input.hasNext()){

myString = input.next();

if (myString.length() == longest) count++;

else

if (myString.length() > longest){

longest = myString.length();

count = 1;

}

}

Explanation:

5 0
1 month ago
Read 2 more answers
Jack is an accountant. He can't access the spreadsheet software, which is installed on the server. What should Jack do?
Amiraneli [1052]
Restart and troubleshoot. 
6 0
1 month ago
Read 2 more answers
Why do we need the Domain Name System (DNS)? Given the domain name www.flamingflamingos.eu, what is the top level domain in this
Harlamova29_29 [1022]

Explanation:

The Domain Name System (DNS) is necessary because it links us to websites by translating domain names into their corresponding Internet Protocol (IP) addresses.

The top-level domain (TLD) for www.flamingflamingos.eu is .eu.

The TLD represents the final segment of the domain name.

There are four distinct nameservers that must be contacted during the lookup process, including the root server.

The total time taken depends on the internet connection speed.

Once the IP address (in this case, 88.151.243.8) is found, your computer uses this information to connect directly to the intended website.

8 0
3 months ago
Other questions:
  • How to code 2.9.5: Four colored triangles {Code HS}
    10·1 answer
  • Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input.
    6·1 answer
  • Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year
    13·2 answers
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • There are two algorithms called Alg1 and Alg2 for a problem of size n. Alg1 runs in n2 microseconds and Alg2 runs in 100n log n
    13·1 answer
  • Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
    7·1 answer
  • Question 1 :Which type of unshielded twisted pair (UTP) cable is commonly used for 1000BASE-T Ethernet networks and is often mad
    8·1 answer
  • Write a function searchBooks which returns ALL the books written by a specific author and return the list of the book titles as
    5·1 answer
  • Of 500 sessions that occurred on a website during a one-week period, 200 of them started on the homepage; 100 of these 200 sessi
    10·1 answer
  • A technician needs to check the system settings on a remote computer to make sure it will be compatible with a new software upda
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!