Question: the lab 4 is The IF Statement and then the thats my Code Go to your Lab 4 assignment and add a loop to the

the lab 4 is The IF Statement and then the thats my Code the lab 4 is The IF Statement and then the thats my
Code Go to your Lab 4 assignment and add a loop to
the question that is asked about animals. This loop should check if

Go to your Lab 4 assignment and add a loop to the question that is asked about animals. This loop should check if the user entered a valid answer. If the answer is not valid it should tell the user what the valid options are and then loop back to the question. Note that this may require rewriting parts of your IF statement. Requirements: Use a loop. Use an output to inform the user of valid responses that can be used. The loop should ask the question again and allow the user to reenter their response. . See the flowchart for an example of the logic that should be used: INPUT answer answer is not equal to yes or no "True OUTPUT "Entera valid response INPUT answer he c C https://templej desire2learn.com/de/content/128277/viewContent/1609634/View You will need to add the following to your code: OUTPUT "Do you have any cats?" (NOTE: If you would rather use a different animal, that is fine) Then accept a user INPUT. Create an IF statement that checks the value of the INPUT If the user says yes, then give a message IF the user say no, then give a different message. Next, regardless of which choice they made, display the following: "Thank you for sharing." Important notes: Your code MUST be in C++. If it is not, it will not be graded and will be an F. The code for your program MUST run. If it does not run, it will be an F. The code for your program MUST include comments. Use comments to explain what the code is doing, Note that for this particular assignment, the comments will be very simple. You can either submit your cop file or copy and paste ALL of your code into a notepad (NOT Word) document. Do not submit the project file for this assignment, I just want the code that you typed Submissions P202AM Type here to search 1 2 3 4 5 6 7 8 using namespace std; int main #include 30 { //declaring s variable for yes or no input string 5; // printing msg on screen cout > S; //checking user entered yes or no if (s == "yes") //if user entered yes then this is the output cout

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!