I am trying to get the program to prompt the user to put in input and then ask again.  I think I have to use 'do while' loops. int a;do {cout << "put in name" << endl;} while (a <= 3);cin >> a;if (a == 1) {cout << "hello world" << endl;}else if (a == 2) {cout << "hello, from Filthy Frank" << endl;}else if (a == 3) {cout << "what's up, world" << endl;}else {cout << "goodbye world" << endl;} Please help me with this problem using c++.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 5E
icon
Related questions
icon
Concept explainers
Question
100%

I am trying to get the program to prompt the user to put in input and then ask again.  I think I have to use 'do while' loops.

int a;
do {
cout << "put in name" << endl;
} while (a <= 3);
cin >> a;
if (a == 1) {
cout << "hello world" << endl;
}
else if (a == 2) {
cout << "hello, from Filthy Frank" << endl;
}
else if (a == 3) {
cout << "what's up, world" << endl;
}
else {
cout << "goodbye world" << endl;
}

Please help me with this problem using c++.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr