Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; int main(){ string x; char userInput; //char userInput; to declare the userInput variable do { // do statement to run

#include

#include

using namespace std;

int main(){

string x;

char userInput; //char userInput; to declare the userInput variable

do { // do statement to run the cases after it.

cout //list of edit operations

cout

cout

cout

cout

cout

cin >> userInput; //user enters a input

userInput = toupper(userInput); //user can input either lower case or upper case letters

switch(userInput){ //takes the variable and gives it options and for each option gives a output

case 'D': cout

break ;

case 'F' : cout

break ;

case 'I' : cout

break ;

case 'R' : cout

break ;

case 'Q' : cout

break ;

default: cout

}

} while (userInput != 'Q' ); // do statement runs the loop first and then the while statement checks for input

return 0;

}

image text in transcribedimage text in transcribed

I completed the program and I'm being asked to try out all the functions and fill out that table. Can someone please help me out with that.

Table Tools References Mailings Review View Design Layout Tell me what you want to do - - --- | Border - - pt Shading BorderPen Color . ; Styles Pen Color - Table Styles Borders Actual Outputs Expected Outputs Result Test Number/Name Inputs Pass/ Fail? 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 displaved 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 Q as your selection: The main control routine for such a program would implement the pseudocode that follows. 0 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

Step: 1

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

More Books

Students also viewed these Databases questions

Question

Respond to personality differences among people.

Answered: 1 week ago

Question

1. Identify and control your anxieties

Answered: 1 week ago