● Chapter 4: Use functions to organize the program Update the program so it uses functions to organize the code so it's easier to reuse and 100 maintain. atlet lobos ort bna asim Console diw test noortw 1500 ons allucin ● Baseball Team Manager MENU OPTIONS 1- Calculate batting 2 Exit program Fe average 31 55 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: 2 Bye! Menu option: 3 Not a valid option. Please try again. MENU OPTIONS 1 Calculate batting average 2 Exit program hogstmins 701 819kjoris best way Specifications Use a function to store the code that displays the separator line. Use a function to store the code that displays the title. Use a function to store the code that displays the menu. Use a function to store the code that calculates the batting average. Use a main function to store the rest of the code. Assume the user will enter valid data. If the user enters an invalid menu option, display an error message and display the menu again so the user can clearly see the valid menu options.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 9PP
icon
Related questions
Question
●
Chapter 4: Use functions to organize the program
1970./
Update the program so it uses functions to organize the code so it's easier to reuse and
maintain.
dons
9113910s ont bns
Console
Baseball Team Manager
MENU OPTIONS
1 - Calculate batting average
2- Exit program
apibendos
Menu option: 1
Calculate batting average...toulav hastai
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 OPTIONS
1 - Calculate batting average
2- Exit program
Menu option: 2
Bye!
abini ghal
aq ses fona) ber
no tedi eshino bilavni olboed of sqmorro a no
n8 701 "x" sli
Sulev hagstni n8 701 "x" il gongeure
8.kjpris best w 152
bynal vide
Specifications
Use a function to store the code that displays the separator line.
67
Use a function to store the code that displays the title.
Use a function to store the code that displays the menu.
Use a function to store the code that calculates the batting average.
Use a main function to store the rest of the code.
612
Assume the user will enter valid data.
If the user enters an invalid menu option, display an error message and display the
menu again so the user can clearly see the valid menu options.
Transcribed Image Text:● Chapter 4: Use functions to organize the program 1970./ Update the program so it uses functions to organize the code so it's easier to reuse and maintain. dons 9113910s ont bns Console Baseball Team Manager MENU OPTIONS 1 - Calculate batting average 2- Exit program apibendos Menu option: 1 Calculate batting average...toulav hastai 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 OPTIONS 1 - Calculate batting average 2- Exit program Menu option: 2 Bye! abini ghal aq ses fona) ber no tedi eshino bilavni olboed of sqmorro a no n8 701 "x" sli Sulev hagstni n8 701 "x" il gongeure 8.kjpris best w 152 bynal vide Specifications Use a function to store the code that displays the separator line. 67 Use a function to store the code that displays the title. Use a function to store the code that displays the menu. Use a function to store the code that calculates the batting average. Use a main function to store the rest of the code. 612 Assume the user will enter valid data. If the user enters an invalid menu option, display an error message and display the menu again so the user can clearly see the valid menu options.
●
Chapter 4: Use functions to organize the program
1970./
Update the program so it uses functions to organize the code so it's easier to reuse and
maintain.
dons
9113910s ont bns
Console
Baseball Team Manager
MENU OPTIONS
1 - Calculate batting average
2- Exit program
apibendos
Menu option: 1
Calculate batting average...toulav hastai
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 OPTIONS
1 - Calculate batting average
2- Exit program
Menu option: 2
Bye!
abini ghal
aq ses fona) ber
no tedi eshino bilavni olboed of sqmorro a no
n8 701 "x" sli
Sulev hagstni n8 701 "x" il gongeure
8.kjpris best w 152
bynal vide
Specifications
Use a function to store the code that displays the separator line.
67
Use a function to store the code that displays the title.
Use a function to store the code that displays the menu.
Use a function to store the code that calculates the batting average.
Use a main function to store the rest of the code.
612
Assume the user will enter valid data.
If the user enters an invalid menu option, display an error message and display the
menu again so the user can clearly see the valid menu options.
Transcribed Image Text:● Chapter 4: Use functions to organize the program 1970./ Update the program so it uses functions to organize the code so it's easier to reuse and maintain. dons 9113910s ont bns Console Baseball Team Manager MENU OPTIONS 1 - Calculate batting average 2- Exit program apibendos Menu option: 1 Calculate batting average...toulav hastai 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 OPTIONS 1 - Calculate batting average 2- Exit program Menu option: 2 Bye! abini ghal aq ses fona) ber no tedi eshino bilavni olboed of sqmorro a no n8 701 "x" sli Sulev hagstni n8 701 "x" il gongeure 8.kjpris best w 152 bynal vide Specifications Use a function to store the code that displays the separator line. 67 Use a function to store the code that displays the title. Use a function to store the code that displays the menu. Use a function to store the code that calculates the batting average. Use a main function to store the rest of the code. 612 Assume the user will enter valid data. If the user enters an invalid menu option, display an error message and display the menu again so the user can clearly see the valid menu options.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage