Question
JAVA Imagine that two baseball teams, Rangers and Yankees, play in the World Series Championship games this year. Write a Java program that can store
JAVA
Imagine that two baseball teams, Rangers and Yankees, play in the World Series Championship games this year. Write a Java program that can store the imagined scores (home runs) of each team at the end of the first official nine innings of each game. The program reads the scores of each team from the console and stored them in data variables. At the end, the program displays (to the console) the result of each game, i.e. which team is winning (we assume no tie game) at the end of the 9th inning, and displays the team who wins the series. The Championship series end if one of the teams wins 4 games. Create two single-dimensional arrays with 7 cells to save game scores of each team.
Sample of the output:
Game 1: Rangers wins.
Game 2: Yankees wins.
Game 3: Rangers wins.
Game 4: Rangers wins.
Game 5: Rangers wins.
Rangers wins the Championship!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started