Write a C++ program that prompts the user with the following menu options: M[atrix] R[everse-String] P[arking...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
C program that implements the menu options for Matrix ReverseString and Parking Fee include using namespace std Function to calculate the mean average ... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
A hospital uses an application that stores patient X-ray data in the form of large binary objects in an Oracle database. The application is hosted on a UNIX server, and the hospital staff accesses...
-
An appropriate structure for large-scale distributed systems is as multiple, independently administered, firewall-protected, domains. Examples are a national health service, a national police service...
-
Please do the following Matlab problem, 1.Write a for loop ranging from 3 to 5. In the loop, print the value of the loop index to the screen using fprintf in the following format: Value is n where n...
-
Silverago Incorporated, an international metals company, reported a loss on the sale of equipment of $2 million in 2010. In addition, the companys income statement shows depreciation expense of $8...
-
Find the frequency domain current I0 as shown. j1 Io 2
-
Collie Company incorrectly included $23,000 of goods held on consignment for Retriever Company in Collie's beginning inventory for the year ended December 31, 2013. The ending inventory for 2013 and...
-
The market research department of a chain of hamburger restaurants wants to compare the mean monthly sales of hamburgers under three different marketing strategies. It randomly assigns 15 restaurants...
-
The December 31, 2015, unadjusted trial balance for Demon Deacons Corporation is presented below. At year-end, the following additional information is available: a. The balance of Prepaid Rent,...
-
On September 25, 2023, Homeowner met with Contractor to discuss an addition that Homeowner wanted to add to his house. Homeowner wanted Contractor to build a large primary bedroom with a large,...
-
Kolbec Community College (KCC) has 4,000 full-time students and offers a variety of academic programs in three areas: professional studies, arts, and technology. The professional studies programs...
-
Search the Web for effective meeting strategies. Identify several helpful techniques. In addition, identify at least one tool that allows you to run electronic or online meetings. Describe
-
What would be the voltage on a 4700uF capacitor 3.2 seconds after a 2602 resistor were connected across its terminals, assuming that the capacitor initially had a voltage of 12V on it?
-
How does ERP enable real-time collaboration and visibility among supply chain partners?
-
A bicycle with 0.33 m radius wheels accelerates from rest to 9.67 m/s in a distance of 13.6 m with no slipping of the tires. Through what angle (in radians) do the wheels turn in this interval? rad...
-
How does linear programming support decision-making in risk assessment and mitigation for operational disruptions in operations management?
-
We're looking at the dawn of modern mathematics. Focus on connections between the 17th century and Indian mathematics when discussing the 17th century. Modern mathematics is modeled on Greek...
-
2. Compare between Substitution Cipher and Permutation cipher.
-
Use critical values to test the null hypothesis H0: 1 2 = 20 versus the alternative hypothesis H0: 1 2 20 by setting a equal to .10, .05, .01, and .001. How much evidence is there that the...
-
What tag marks the beginning and end of an HTML documents head section?
-
How do you open a file so that new data will be written to the end of the files existing data?
-
What is the difference between using the Applet method asked for in Checkpoint 14.35, and using an AudioClip object to play a sound file? Data in Checkpoint 14.35 What Applet method can you use to...
-
The risk that can be diversified away is best described as: A. beta risk. B. systematic risk. C. unsystematic risk.
-
Which of the following statement is not true: A. A company's beta does not change over time. B. The fundamental beta allows for potential of beta to change over time. C. An historical beta is...
-
An efficient portfolio, according to Markowitz, is all but which of the following: A. lowest risk for a given level of expected return. B. greatest expected return for a given level of risk. C....
Study smarter with the SolutionInn App