Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Remember to review the cpp directions and options pdf file: If you downloaded Visual Studio, you will be submitting a file named Lab4.cpp If you
- Remember to review the cpp directions and options pdf file:
- If you downloaded Visual Studio, you will be submitting a file named Lab4.cpp
- If you use an online C++ compiler, you can submit your code in the text entry box.
- In this lab, you are to use what you learned about Control Structures (Selection) in chapter 4.
- Redo Lab#3 but use ado whileloop to repeat the menu options.
- Make sure the menu display again even if the user puts in a character instead of a number, that is, do input error checking right after the input of the menu option. We learned about this in chapter 3.
Example of a do...while loop:
// do something until the number equals 3
int number;
do
{
cout << "Enter a number: ";
cin >> number;
//input error checking happens here. you need to clear input stream, ignore the rest of the input line
// then prompt the user and take input again
// process a task until user enters a 3 for number.
}while(number !=3);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started