Question: Need help with C++ program. Make the program provide the same output as the expected output below. void readInt(string prompt, int &num) (****new for this

Need help with C++ program. Make the program provide the same output as the expected output below.

void readInt(string prompt, int &num) (****new for this level****) 1. This functionshould be used any time you read any integers from the user.Use this function to read the menu option from the user. 2.It takes a string prompt, outputs it, reads a number from theuser, validates and returns the num by reference. 3. See Samplea01.cpp forthe function. You may use the function in the sample. 4. You

void readInt(string prompt, int &num) (****new for this level****) 1. This function should be used any time you read any integers from the user. Use this function to read the menu option from the user. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. See Samplea01.cpp for the function. You may use the function in the sample. 4. You must catch all invalid data such as characters, negative numbers etc. void readDouble (string prompt, double &num) (****new for this level****) This function should be used any time you read any floats or doubles from the user. Use this function to read the cost of the item, tip, etc from the user. 1. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. Write it exactly like the readint but declare a double or float instead of an int. 4. You must catch all invalid data such as characters, negative numbers etc. void placeOrder (double &cost) 1. Call this function if the user selects 1 from the menu. 2. This function will go through a loop and ask the user to enter item names and their cost until the user answers 'n' to the question - Do you want another item? (y/n): You must validate to make sure the user enters y/n for this question (it should not be case sensitive - must accept both uppercase and lowercase). Use a while loop to do this. 3. The total cost must be returned through the reference parameter and be printed in main(). 4. Call the readDouble function to do this. You must catch all invalid data such as characters, negative numbers etc. 5. Do not print anything in this function. The tip, discount, and final total must be printed in main ().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!