Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Imagine that two basketball teams, Milwaukee Bucks and Golden State Warriors, play in the NBA grand final this year. They will play 7 games. Write

Imagine that two basketball teams, Milwaukee Bucks and Golden State Warriors, play in the NBA grand final this year. They will play 7 games. Write a Java program that can store the imagined scores of each team at the end of the regular time of each game of the all 7 games. The program reads the scores of each team from the console and stored them in arrays.

At the end, the program first displays (to the console) the score of each team in each game (for all 7 games).

Second, the program displays the result of each game (for all 7 games), i.e. which team is winning or the teams tie at the end of regular time.

Third, the program displays the average score of each team across the 7 games.

Fourth, the program displays in which game(s) each team achieves the highest score.

  • Notes: if more than one game have the highest score, print out them all one game and score in one line.

The inputs must be verified to be sure that they are not negative. All the floating-point numeric output values should have 2 digits after the floating point.

Sample of the output:

Milwaukees scores: 93, 98, 92, 112, 123, 99, 96

Golden States scores: 110, 97, 92, 120, 120, 95, 99

Game 1: Golden State wins

Game 2: Milwaukee wins.

Game 3: Both the teams tied at the end of the regular time.

Game 7: Golden State wins.

Milwaukees average score: 101.86 Golden States average score: 104.71

Highest score for Milwaukee:

Game 5 123

Highest score for Golden State:

Game 4 120

Game 5 120

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago