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
-
The government wishes to estimate the percentage of the adult population that is a homeowner. They plan to sample n adults and present their results in a 95% confidence interval with a width no more...
-
A convex mirror is used to reflect light from an object placed 66cm in front of the mirror. The focal point is 46cm from the mirror. What is the focal length as you would use in the mirror equation?...
-
(5) The game Very Polite Binary Biscuits TM is played just like Binary Biscuits, except the player to eat the last biscuit loses. For which n does the first player have a winning strategy? Prove your...
-
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....
-
Let ¬ be the line through the origin in R2 with direction vector Use the method of Example 6.85 to find the standard matrix of a reflection in . dz
-
Clark works all year at the frontdesk of the DewDrop Inn and earns a salary of $30,000. He is offered the option of a $400-per-month living allowance or rent-free use of a room at the inn. Clark...
-
Analyze transactions ag, using the example that follows. a. Sarah Linton established Kitty-Kat Beauty Parlor, Inc., by incorporating and investing $2,400 in exchange for 240 shares of $10 par value...
-
On July 1, 2014, Visnak Satellites issued $4,500,000, 7%, 10-year bonds at $4,194,218. This price resulted in an effective-interest rate of 8% on the bonds. Visnak uses the effective interest method...
-
Translate the polar curve into rectangular coordinates and give the coordinates of the center of the circle and the radius of the circle. Starting at theta = 0, find the value for theta that would...
-
It is now January 2018. The year 2017 finished well. The finalized year-end financial statements for 2017 are provided in the excel file associated with this assignment. Randolf and Tenisa at Comfy...
-
How do advances in chromosome conformation capture techniques, such as Hi-C and 3C-based methods, contribute to our understanding of chromosomal interactions, spatial organization, and the functional...
-
Your company's management is considering a proposal which would require the internal auditors to participate in collecting the bids and controlling the competitive bidding practices in the purchasing...
-
You are a CIA and the director of internal auditing in a publicly held manufacturing corporation, Conrod, which deals in consumer products. The company has developed a new line of baby carriages....
-
Adriana Lopez receives the March bank statement for Success Systems on April 11, 2008. The March 31 bank statement shows an ending cash balance of \($86,896\). A comparison of the bank statement with...
-
Control of cash A good system of cash control helps protect both cash receipts and cash disbursements. 1. What are three basic guidelines that help achieve this protection? 2. Identify a control...
-
Adjusting entries from bank reconciliation Prepare the adjusting journal entries that Del Gato Clinic must record as a result of preparing the bank reconciliation in Exercise 8-7. Exercise 8-7: Bank...
-
nt Two, Chapter Six + App. Il Saved A form attached to the counted items in the process of taking a physical inventory is a(n) Multiple Choice here to search Subsidiary record Sales receipt Sales tag...
-
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 +...
-
Continuation of SI 0-3: inventory, purchases, and cost of goods sold (Learning Objective 2) In SI0-3, Grippers expects cost of goods sold to average 65% of sales revenue and the company expects to...
-
Sales Budget (Learning Objective 2) In a series of Short Exercises, you will prepare parts of the master budget for Grippers, which sells its rock-climbing shoes worldwide. We will concentrate on...
-
Revise inventory, purchases, and cost of goods sold budget (Learning Objective 4) Refer to the original Whitewater Sporting Goods Data Set item 5. Suppose cost of goods sold averages 75% of sales...
Study smarter with the SolutionInn App