Update the program so it allows the user to select options from a menu. Console Baseball...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Update the program so it allows the user to select options from a menu. Console Baseball Team Manager MENU OPTIONS 1 - Calculate batting average 2 - Exit program ====: Menu option: 1 Calculate batting average... Official number of at bats: 10 Number of hits: 3 Batting average: 0.3 Menu option: 1 Calculate batting average... Official number of at bats: 11 Number of hits: 4 Batting average: 0.364 Menu option: 3 Not a valid option. Please try again. Menu option: 2 Bye! Specifications Assume the user will enter valid data. Display an error message if the user chooses an invalid menu option %3D %3D %3D %3D Create a program that displays a welcome message and calculates a player's batting average. Console Baseball Team Manager This program calculates the batting average for a player based en the player's official number of at bats and hits. Player's name: Pat Official number of at bats: 11 Number of hits: 4 Pat's batting average is 0.364 Specifications The formula for calculating batting average is: average = hits/ at_bats • The program should accept integer entries. · Assume the user will enter valid data. The program should round the batting averages to a maximum of three decimal places. Update the program so it allows the user to select options from a menu. Console Baseball Team Manager MENU OPTIONS 1 - Calculate batting average 2 - Exit program ====: Menu option: 1 Calculate batting average... Official number of at bats: 10 Number of hits: 3 Batting average: 0.3 Menu option: 1 Calculate batting average... Official number of at bats: 11 Number of hits: 4 Batting average: 0.364 Menu option: 3 Not a valid option. Please try again. Menu option: 2 Bye! Specifications Assume the user will enter valid data. Display an error message if the user chooses an invalid menu option %3D %3D %3D %3D Create a program that displays a welcome message and calculates a player's batting average. Console Baseball Team Manager This program calculates the batting average for a player based en the player's official number of at bats and hits. Player's name: Pat Official number of at bats: 11 Number of hits: 4 Pat's batting average is 0.364 Specifications The formula for calculating batting average is: average = hits/ at_bats • The program should accept integer entries. · Assume the user will enter valid data. The program should round the batting averages to a maximum of three decimal places.
Expert Answer:
Answer rating: 100% (QA)
Answer Explanation Code print60 it will print 60 time print 20Baseba... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
An inexpensive instructional lab microscope allows the user to select its objective lens to have a focal length of 32 mm, 15 mm, or 3.9 mm. It also has two possible eyepieces with magnifications 5 ...
-
a. Write an application that allows a user to select one of at least five television shows to watch on demand. When the user selects a show, display a brief synopsis. Save the file as...
-
Write an application that allows a user to select a country from a list box that contains at least seven options. After the user makes a selection, display the countrys capital city. Save the file as...
-
In Exercises 3542, describe and sketch the surface given by the function. f(x, y) = Jxy, 0, x 0, y 0 x <0 or y < 0
-
Performance ratings are given to company sales staff semiannually. Staff ratings for the past half-year are given below. Determine the median rating. Rating Proportion of Staff 6 .22 7 .36 8 .20 9...
-
Demonstrate that, because we have equal sample sizes, I would have arrived at the same answer in Section 14.10 if I had not pooled the variances, although the degrees of freedom would probably differ.
-
What is the implication of the statement "the books are not in balance"? What corrective action should be taken?
-
Kimble and Sanchez, CPAs, offer three types of services to clients: auditing, tax, and small business accounting. Based on experience and projected growth, the following billable hours have been...
-
Do the following two parts: (a) Find the sum-of-products expansion of the Boolean function F (w, x, y, z) that has the value 1 if and only if an odd number of w, x, y, and z have the value 1. (b)...
-
Dwight Donovan, the president of Donovan Enterprises, is considering two investment opportunities. Because of limited resources, he will be able to invest in only one of them. Project A is to...
-
When reviewing the descriptions of the work environments, identify elements that appear to foster employee motivation and group cohesion among employees. Relate your analysis. For example, there...
-
A particle moves in the \(x\) direction according to the equation \(x(t)=b t^{3}+c t^{2}+d\), where \(b=4.0 \mathrm{~m} / \mathrm{s}^{3}\), \(c=-10 \mathrm{~m} / \mathrm{s}^{2}\), and \(d=20...
-
You are shown a video clip of a dog running in front of a blank wall. The observations are to be plotted using the horizontal and vertical axes labeled with seconds and meters, respectively. How many...
-
A car's speed during the interval \(t=0.5 \mathrm{~s}\) to \(t=20 \mathrm{~s}\) is given by \(t=c \sqrt{t}\), where \(c\) is a constant. Over the interval \(t=10 \mathrm{~s}\) to \(t=20...
-
The position of a cart on a low-friction track can be represented by the equation \(x(t)=b+c t+e t^{2}\), where \(b=4.00 \mathrm{~m}, c=6.00 \mathrm{~m} / \mathrm{s}\), and \(e=0.200 \mathrm{~m} /...
-
Four traffic lights on a stretch of road are spaced \(300 \mathrm{~m}\) apart. There is a 10-s lag time between successive green lights: The second light turns green \(10 \mathrm{~s}\) after the...
-
2. A fund manager is expecting a surge in Turkey's stock market in a month and wants to invest $ 10 million. However, because he doesn't sure about USD/TRY exchange rate's direction, he doesn't want...
-
Suppose the market is semistrong form efficient. Can you expect to earn excess returns if you make trades based on? a. Your brokers information about record earnings for a stock? b. Rumors about a...
-
Java supports three types of comments: ____________, ____________, and javadoc. a. Line, block b. String, literal c. Constant, variable d. Single, multiple
-
a. Search the Java website for information about how to use a JTextArea, its constructors, and its setText() and append() methods. Write an application that allows the user to select options for a...
-
To construct a loop that works correctly, you should initialize a loop control ____________. a. Condition b. Constant c. Structure d. Variable
-
Which elements an agile software team must consider to attribute effort to a product?
-
Why is the rounded Fibonacci series used to assign story points instead of the natural numbers?
-
Variants and exception handlers are alternate flows for a use case. In which situations should one or the other be used?
Study smarter with the SolutionInn App