Write a Java program that keeps up with the scores in a baseball games, then reports...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that keeps up with the scores in a baseball games, then reports them. Ask the user for the home team name and the visiting team name. Set up two arrays that will store the number of runs for nine innings, one for the home team and one for the visiting team. Set up a loop to ask the user for the number of runs scored by each team for each of the nine innings. Write a method (in the same program) that accepts the team name and the scores array (pg 422). The method will write a line that has the team name, the inning scores, and the total score for a team. Have the main method create headings, then call the method to print scores for each team. Example: Team Rangers Dodgers 1 0 Rubric: 2 1 0 3 0 0 4 0 1 5 2 0 0 0 7 2 0 8 0 1 . • Doesn't total the number of runs for each team -10% 9 1 Hints/Tips: • In the loop to get the runs scored for an inning, ask the use how many runs were scored for the home team (Rangers in the example). Then, ask about the visiting team (Dodgers in the example). Be sure to put the inning number in the request Example: How many runs did the Rangers score in inning 3? How many runs did the Dodgers score in inning 3? • When you print, print the column headings in the main method, then call the print scores method twice, once for the home team and once for the visiting team. Be sure to send the team name. • In the print scores method, create an accumulator to sum the number of runs scored and add it in the loop that prints the scores. You can use print or printf to print each score as long as you don't use the \n escape sequence. After all scores have been printed (the loop is complete), then you can print the total, but make sure to use \n or println so that it goes to the next line. •It took me a little less than 35 minutes to complete 0 • Doesn't use arrays to store the number of runs per inning -100% • Doesn't ask the user for the home team and visiting team per inning -20% . • Doesn't put the team name in the request for a given innings score -10% . • Doesn't show the inning in the request for a given innings score -10% • Doesn't ask for both the home and away score by inning -10% • Doesn't use a method to print the scores -20% Total 6 2 Write a Java program that keeps up with the scores in a baseball games, then reports them. Ask the user for the home team name and the visiting team name. Set up two arrays that will store the number of runs for nine innings, one for the home team and one for the visiting team. Set up a loop to ask the user for the number of runs scored by each team for each of the nine innings. Write a method (in the same program) that accepts the team name and the scores array (pg 422). The method will write a line that has the team name, the inning scores, and the total score for a team. Have the main method create headings, then call the method to print scores for each team. Example: Team Rangers Dodgers 1 0 Rubric: 2 1 0 3 0 0 4 0 1 5 2 0 0 0 7 2 0 8 0 1 . • Doesn't total the number of runs for each team -10% 9 1 Hints/Tips: • In the loop to get the runs scored for an inning, ask the use how many runs were scored for the home team (Rangers in the example). Then, ask about the visiting team (Dodgers in the example). Be sure to put the inning number in the request Example: How many runs did the Rangers score in inning 3? How many runs did the Dodgers score in inning 3? • When you print, print the column headings in the main method, then call the print scores method twice, once for the home team and once for the visiting team. Be sure to send the team name. • In the print scores method, create an accumulator to sum the number of runs scored and add it in the loop that prints the scores. You can use print or printf to print each score as long as you don't use the \n escape sequence. After all scores have been printed (the loop is complete), then you can print the total, but make sure to use \n or println so that it goes to the next line. •It took me a little less than 35 minutes to complete 0 • Doesn't use arrays to store the number of runs per inning -100% • Doesn't ask the user for the home team and visiting team per inning -20% . • Doesn't put the team name in the request for a given innings score -10% . • Doesn't show the inning in the request for a given innings score -10% • Doesn't ask for both the home and away score by inning -10% • Doesn't use a method to print the scores -20% Total 6 2
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class BaseballScores public static void mainString args Scanner scanne... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Shauna immigrated to Canada in her 30s and has worked full time earning above YMPE throughout. Now she is a few years from retirement and has found out that her monthly OAS at age 65 will be $520....
-
Blue Water Dredging recorded $10,000 in estimated taxes on the last day of each month and made the payment on the 15th of the following month. On December 31, 2013, Blue Water's year end, it was...
-
If this landfill is judged to be a proprietary fund, what liability will be reported at the end of the second year on fund financial statements? a. $0 b. $110,000 c. $190,000 d. $200,000
-
In August 2014, Superior Structures of Ohio, LLC, and its president, Ryan Villhauer, applied for credit with Willoughby Supply Company, Inc. The application contained a section providing for a...
-
The wheat harvesting season in the American Midwest is short, and most farmers deliver their truckloads of wheat to a giant central storage bin within a two-week span. Because of this, wheat-filled...
-
Objectives: Your company is currently planning to automate many different system administration tasks. Your manager has asked you to research a system administration task and implement it using...
-
Crystal Corporation processes its journal vouchers using batch procedures similar to the process outlined in Figure in the text. To improve customer satisfaction, the sales system is going to be...
-
EECE 470 Computer Networks No.2 Due date: 20th May 2021 Assignment Marks: 10 Question 1 The timer of a system using the Stop-and-Wait ARQ Protocol has a time-out of 6ms and round trip time RTT is...
-
1. What other "full costs of attendance" expenses might be included in a scholarship other than travel to or from home and clothing? Is the $3,000 to $6,000 cost allocation too much, too little, or...
-
This is your first experience with public speaking and you're very nervous. You're afraid you'll forget your speech and stumble. So you're wondering if it would be a good idea to alert your audience...
-
Let's say you have obtained information from an interview, a letter, email, or other person-to-person communication. How should this be cited?
-
how would a kantian critique the message in "An African message for America" that we should help locally ratehr than internationally ?
-
In two weeks, client will use communication management strategies to manage Stephanie will consistently apply communication management strategies to navigate social interactions and relationships,...
-
Write an internship report with below document outline is 1.Introduction: 2.Company Description: 3.Tasks, activities, and observations done during internship: 4.Conclusion: INTERNSHIP AT TOYOTA MOTOR...
-
Evaluate each logarithm to four decimal places. log 0.257
-
Write a method public static void removeMin that removes the minimum value from a partially filled array without calling other methods.
-
Consider an interface public interface NumberFormatter { String format(int n); } Provide four classes that implement this interface. A DefaultFormatter formats an integer in the usual way. A...
-
Consider these methods: public static double f(double x) { return g(x) + Math.sqrt(h(x)); } public static double g(double x) { return 4 * h(x); } public static double h(double x) { return x * x +...
-
The SDLC is just one model for systems development. Find at least one more and describe the differences.
-
Draw DFDs for each of these scenarios: (a) A customer goes into a bookshop and asks for this book. The member of staff looks for the book in the online stock catalogue and reports that the book is...
-
Draw an entity model to model this university scenario: A university department employs lecturers and clerical staff. It offers a three-year degree. A student has to take 12 modules during the...
Study smarter with the SolutionInn App