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
-
What is the tax treatment for a guaranteed payment?
-
A 6.5 percent coupon bond with 14 years left to maturity is priced to offer a 7.2 percent yield to maturity. You believe that in one year, the yield to maturity will be 6.8 percent. What is the...
-
Interest calculated on the principal plus previous amounts of interest accumulated. True/false
-
The following independent situations describe facts concerning the ownership of various assets. (a) Dickenton Company purchased a tooling machine in 1996 for $85,000. The machine was being...
-
1. Jason and Marie both travel 75 miles by car. Jason drives on average 20 mph faster than Marie and Jason did the trip in one hour less than Marie. What was Jason's average speed ? 2. The sum of...
-
1. Assume that a third party(ies) is considering whether to sue the external auditors of QSGI. What could they allege in their lawsuit and why? 2. Assuming a third party(ies) files the lawsuit, what...
-
Macmillan Learning Compliance occurs outside of our awareness. never occasionally often always
-
Suppose Big Trucks Dealership is opening a regional office in St. Louis. Lesa Carter, the office manager, is designing the internal control system. Carter proposes the following procedures for credit...
-
How do we usually distinguish between business and nonbusiness income? How are the two treated?
-
What are the common definitions of a unitary business?
-
How does double weighting of the sales apportionment factor favor firms that are located in a state? How does the absence of a throwback rule do the same?
-
What are the basic differences between unitary and separate accounting states?
-
Use frequency analysis to deecipher the message for the bar chart
-
Akramin just graduated with a Master of Engineering in Manufacturing Engineering and landed a new job in Melaka with a starting salary of RM 4,000 per month. There are a number of things that he...
-
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
-
Define a business transaction in the broad sense and give examples of the two different kinds of transactions.
-
What two equalities in accounting must be maintained in transaction analysis?
-
What is a T-account? What is its purpose?
Study smarter with the SolutionInn App