Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that prompts the user with the following menu options: M[atrix] R[everse-String] P[arking Fee] If the user selects M or m

Write a C++ program that prompts the user with the following menu options: M[atrix] R[everse-String] P[arking If the user selects  If the user enters

Write a C++ program that prompts the user with the following menu options: M[atrix] R[everse-String] P[arking Fee] If the user selects "M" or "m" then . 1. the program should prompt the user to enter five integer sets of four numbers (1 to 3) and store the numbers in a 5 x 4 array called Data[5][4]. 2. display the following sub-menu for Matrix and implement the followings: A[verage] F[requency] P[revious Menu] 1. If the user selects "A or a" then your program should pass the array Data[][] from main () to a function double Mean (const int Data [][], int, int) that receives the array Data [][] and its dimensions as arguments to find the average of the numbers in the array and prints the results in function main (). 2. If the user selects "F or f" then your program should pass the array Data[ ][ ] from main () to a function void frequency (int const Data [ ][], int, int) that receives the array Data [][] and its dimensions as arguments and counts the number of responses (frequency) of each number, then pints the frequency as its histogram as follows: Response 1 2 3 Frequency 1 3 Q[uit] 4 . If the user selects "R" or "r" then call a user-defined function void rev_str (void) that 1. Prompts the user to enter a string and store it into a one-dimensional character array called Input_String []. 2. Replace the content of the original string with the string reversed and save into another character array called Output_String[]. 3. Print both the original string and reversed string in function rev_str (void). If the user selects "P" or "p" then Develop and write a menu-driven C++ function, using control structures and user- defined functions, to solve for the following problem. (Note: you may declare the parking fee schedule as const variables.) The sign on the attendant's booth at the Brazosport College parking lot is: Brazosport College Visitors Parking Fee Vehicle Type Cars & Motorcycles: First 1 Hour: Next 2 hours (hours 2 - 3): Next 5 hours (hours 2 - 6): Thereafter (after hour 6): Senior Citizens: Free $2.00 per hour $1.0 per hour $0.50 per hour (more than 8 hours) Free Upon execution of the program, the screen will be cleared, and the following menu will appear at the top of the screen, properly centered: H[elp] C[ars/Motorcycles] S[enior Citizens] P[revious Menu] H or h (for Help) option will briefly explain how the program should be used. Display of the parking fees shown above along with explanatory notes will help here. Once the user finishes reading the help screen(s), striking any key (strike a key followed by Enter key) will clear the screen and the menu is displayed again. The text for this help menu should be read from an ASCII text file (help.txt). C or c (for Cars & Motorcycles) option will prompt the user for the number of minutes a vehicle has been in the lot. The program should then compute the appropriate charge and display the ticket on the monitor for the customer, as well as writing/adding the same to an ASCII file called parking_Charges. Any part of an hour is to be counted as a full hour (e.g., 65 minutes will be two hours.) Once the user finishes viewing the ticket, striking any key will clear the screen and the above menu is displayed again. S or s (for Senior Citizens) option will prompt the user for the number of minutes a vehicle has been in the lot. The program performs no computations. The ticket should show $0.00, and this information should be written/added to an ASCII file called parking_Charges. Once the user finishes viewing the ticket, striking any key will clear the screen and the menu is displayed again. If the user enters "Q" or "q" then you should verify that the user wants to terminate the program before actually terminating the program. . If the user enters, any other selection it should prompts the user invalid selection and allows the user to try again. IMPORTANT NOTES. READ CAREFULLY-Non-compliance with these notes will cost you points 1. Make sure your program is VIRUS FREE! (Grade of 0 will be given for infected programs). 2. Provide a brief description of the problem being solved and comment your program. Use meaningful prompts. 3. Be sure to include a header file at the beginning of your program as shown in the course syllabus and sample folders 4. Full function prototyping is required. Functions must have their purposes fully explained. Functions may call other functions, as needed, to facilitate modular programming.

Step by Step Solution

3.54 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

C program that implements the menu options for Matrix ReverseString and Parking Fee include using namespace std Function to calculate the mean average ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Starting Out With Java From Control Structures Through Data Structures

Authors: Tony Gaddis

6th Edition

0133957055, 978-0133957051

More Books

Students also viewed these Programming questions