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


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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
