Question: import java.util.Scanner; public class PeopleWeights { public static void main(String[] args) { Standards that you MUST adhere to for this assignment: Use Eclipse to write

import java.util.Scanner;

public class PeopleWeights { public static void main(String[] args) {

Standards that you MUST adhere to for this assignment:

  • Use Eclipse to write a code.
  • In your code:
    • Create the class called Baseball_YourName
  • Code should be written well with the appropriate programming techniques.
    • Use the standards taught to you for source code indentation and formatting as well as consistency in names.
    • Use the /* ** */ format of comments to put add the heading of your program. It should include Author:, Date:, Course and Section Number:, Program Name:, Program Purpose
    • Your heading should include an algorithm.
    • Use the // format of comments to put comments within the code.
import java.util.Scanner; public classimport java.util.Scanner; public classimport java.util.Scanner; public classimport java.util.Scanner; public class
Challenge Problem Solving Loops and Arrays Problem Description/Purpose: . Write a program that will compute and display the final score of two teams in a baseball game. The number of innings in a baseball game is 9. Your program should read the name of the teams. While the user does not enter the word done for the first team name, your program should read the second team name and then read the number of runs for each Inning for each team, calculate the total scores and display the total score for each team. o Create a constant for 9 innings. Create an array of String to hold the baseball team names (Array size is 2) o Create an array to store each team's total scores. (Array size is 2) o You know there are exactly 2 teams. You also know there are exactly 9 innings. Use loops such that: o for team, for inning, the user enters the number of runs scored and adds to the total for each team. o Display the final scores afterwards. o Repeat with new teams until the user enters the word "done" instead of a name for the first team name. o End the program with the words "Program complete" Hints: o STUDY THE OUTPUT EXAMPLES at the end of this document very carefully. o This project will need multiple for loops and a while loop. o You may need to use a blanket statement of keyboard. nextLine() if you are reading a sequence of integers and then a nextLine. Requirements/Task(s): The appropriate set of variables and data types for those variables should be created. Feel free to create AS MANY variables as you need. You must use a constant for the number of Innings. You must use for loop(s) and a while loop where appropriate.\fOutput of 2 teams and scores: sterminated> Baseball Game [Java Application] CA\\Program Files\\avalick-9.0.1\\binijavaw 4. 2018 9:24:00 PM) Please enter done or enter the name of the first team Diamond Backs Please enter the name of the second team Chicago Cubs How many runs were scored in inning 1 by team Diamond Backs? How many runs were scored in inning 2 by team Diamond Backs? 4 How many runs were scored in inning 3 by team Diamond Backs? 5 How many runs were scored in inning 4 by team Diamond Backs? 3 How many runs were scored in inning 5 by team Diamond Backs? 8 How many runs were scored in inning 6 by team Diamond Backs? 10 How many runs were scored in inning 7 by team Diamond Backs? How many runs were scored in inning 8 by team Diamond Backs? 3 How many runs were scored in inning 9 by team Diamond Backs? 6 How many runs were scored in inning 1 by team Chicago Cubs? How many runs were scored in inning 2 by team Chicago Cubs? 5 How many runs were scored in inning 3 by team Chicago Cubs? B How many runs were scored in inning 4 by team Chicago Cubs? 5 How many runs were scored in inning 5 by team Chicago Cubs? 6 How many runs were scored in inning 6 by team Chicago Cubs? 3 How many runs were scored in inning 7 by team Chicago Cubs? 4 How many runs were scored in inning 8 by team Chicago Cubs? 7 How many runs were scored in inning 9 by team Chicago Cubs? B Team : Diamond Backs Total Score: 44 Team : Chicago Cubs Total Score: 48 Please enter done or enter the name of another first team done Program complete!\f

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!