Question: Update the program so it allows the user to select options from a menu. Console Baseball Team Manager MENU OPTIONS 1 - Calculate batting

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.
Step by Step Solution
3.50 Rating (147 Votes )
There are 3 Steps involved in it
Answer Explanation Code print60 it will print 60 time print 20Baseba... View full answer
Get step-by-step solutions from verified subject matter experts
