Question: DIRECTIONS Write a program and name it lab3c.cpp. Define a character variable and initialize it to the letter ' n '; Define an integer variable

DIRECTIONS\ Write a program and name it lab3c.cpp.\ Define a character variable and initialize it to the letter '

n

';\ Define an integer variable and initialize it to zero.\ Add a while loop that will repeat until the letter they enter is '

y

' or they correctly calculated

4+18

. Both conditions must be true for the loop to quit.\ The following code should happen inside the loop:\ ask the user "Please enter a letter."\ Read in their letter.\ Print out the letter they entered.\ Ask the user for the result of the calculation of

4+18

.\ SAMPLE OUTPUT\ What do you get if you. add

4+18

? 20\ Enter the letter '

y

' if you want to quit.\ Y\ The letter you entered is

y

\ oh goat foot! You forgot how to add!\ What do you get if you add

4+18

? 22\ Enter the letter '

y

' if you want to quit.\ n\ The letter you entered is

n

\ What do you get if you add

4+18

? 22\ Enter the letter '

y

' if you want to quit.\ Y\ The letter you entered is y

 DIRECTIONS\ Write a program and name it lab3c.cpp.\ Define a character

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!