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
Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
fgiga [73]

I agree with the programmers who think object-oriented programming is a superior approach to procedural programming.

<h3>Why is OOP better than procedural programming?</h3>

In terms of Security, Object-oriented programming is said to have more of a secure based than procedural programming, due to the level of abstraction or that is due to data hiding property.

Note that  It hinders the access of data to any member functions of the same class and one cannot see a thing like that such as data hiding in the procedural programming framework.

Learn more about object-oriented programming  from

brainly.com/question/12342989

#SPJ1

4 0
1 year ago
Which of the following is an antivirus software?
kotegsom [21]

Answer:

McAfee

Explanation:

An antivirus is a standalone software that protects other software. On the other hand, a Firewall is capable of preserving both software and hardware on the network.

4 0
2 years ago
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T
hammer [34]

Answer:

In C++:

#include<iostream>

#include<vector>

using namespace std;

int main() {

int len;

cout<<"Length: ";  cin>>len;

string inpt;

vector<string> vect;

for(int i =0;i<len;i++){

   cin>>inpt;

   vect.push_back(inpt); }

char ch;

cout<<"Input char: ";  cin>>ch;  

for(int i =0;i<len;i++){

   size_t found = vect.at(i).find(ch);  

       if (found != string::npos){

           cout<<vect.at(i)<<" ";

           i++;

       }

}  

return 0;

}

Explanation:

This declares the length of vector as integer

int len;

This prompts the user for length

cout<<"Length: ";  cin>>len;

This declares input as string

string inpt;

This declares string vector

vector<string> vect;

The following iteration gets input into the vector

<em>for(int i =0;i<len;i++){ </em>

<em>    cin>>inpt; </em>

<em>    vect.push_back(inpt); } </em>

This declares ch as character

char ch;

This prompts the user for character

cout<<"Input char: ";  cin>>ch;  

The following iterates through the vector

for(int i =0;i<len;i++){

This checks if vector element contains the character

   size_t found = vect.at(i).find(ch);  

If found:

       if (found != string::npos){

Print out the vector element

           cout<<vect.at(i)<<" ";

And move to the next vector element

           i++;

       }

}  

4 0
3 years ago
What happens it the offshore team members are not able to participate in the iteration demo due to time zone/infrastructure issu
professor190 [17]

The best option that will suite is that there will be no major issues since the offshore leads and the onsite members participated in the demo with the Product Owner/Stakeholders they can cascade the feedback to the offshore members

Explanation:

Iteration demo is the review which is done to gather the immediate feedback from the stakeholders on a regular basis from the regular cadence. This demo will be one mainly to review the progress of the team and the and to cascade and show their working process

They show their working process to the owners and they and the other stakeholders and they get their review from them and so there will be no issues if the members are not able to participate

5 0
3 years ago
The columns of a spreadsheet data source are A. form letters. B. the mailing list. C. data points. D. fields.
mojhsa [17]

I believe it is C, I'm so sorry if im incorrect.

8 0
3 years ago
Other questions:
  • How to get out of compatibility mode in word?
    15·1 answer
  • who will follow me on tiktok and like all my videos? if you do ill give branlist and give u a shoutout and you can enter my big
    15·1 answer
  • Please create C program, the task is to implement a function edoublepowerx that has an input parameter x of floating-point value
    11·1 answer
  • What is a system unit
    7·1 answer
  • What does SFA software provides tools for
    11·2 answers
  • Binary Search:<br><br><br> 2 6 15 42 55 89 111 256
    6·1 answer
  • A security administrator plans to conduct a vulnerability scan on the network to determine if system applications are up to date
    15·1 answer
  • Write a program that prompts the user to enter three words. The program will then sort the words in alphabetical order, and disp
    14·1 answer
  • What is the output of the following JavaScript code?
    9·1 answer
  • True or False: Once you rename a field, the new field name must be used in the rest of the search string.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!