Question: Question 1 A do-while statement is often used to control a menu-driven program that displays a list of choices from which the program use selects

 Question 1 A do-while statement is often used to control a

Question 1 A do-while statement is often used to control a menu-driven program that displays a list of choices from which the program use selects a program operation. For example, the menu displayed for a text editing program might look like this: List of edit operations: D- Delete a substring. F - Find a string. I - Insert a string R- Replace a substring. Q- Quit Enter D, F, I, R, or as your selection: The main control routine for such a program would implement the pseudocode that follows. do Display the menu (call a function: displayMenu(), which displays the above menu) Read the user's choice (by using cin). Perform the user's choice (use a switch statement here. The control variable is a char variable determined from the above cin. If the car variable is 'D', then print out a message: Delete a substring. For other choices, print out the corresponding message. while the choice is not Quit When you run this program, test all the choices of the switch statement

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 Databases Questions!