Question: NEED HELP WITH PART 2!! What am I doing wrong?? 4.9 Lab: Random Animal Part 1: Complete the survey. Part 2: Peek-a-boo is a fun

 NEED HELP WITH PART 2!! What am I doing wrong?? 4.9Lab: Random Animal Part 1: Complete the survey. Part 2: Peek-a-boo is

NEED HELP WITH PART 2!! What am I doing wrong??

4.9 Lab: Random Animal Part 1: Complete the survey. Part 2: Peek-a-boo is a fun game that little kids like to play. To simulate this game on the computer, write a program that will generate a random number between 1 and 4. Then, will print to the screen the animal name associated to that number. The animal names used will be: pig when a 1 is generated Cow when a 2 is generated chicken when a 3 is generated horse when a 4 is generated If your program generates a 3, the output will be: chicken The player will then enter a 1 if they would like to play again or anything else to exit the program. If the player enters "1110', the output will be: horse chicken cow Hint: To make testing easier, seed your random number generator with 0. 293998.1714202 LAB ACTIVITY 4.9.1: Lab: Random Animal 2/10 main.cpp Load default template... 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() { 7 8 9 10 srand(); 11 int playNum; 12 int randomAnimal; 13 14 cin >> playNum; 15 16 while (playNum != 0) 17 randomAnimal = rand() % 4 + 1; 18 cin >> playNum; 19 if (randomAnimal == 1) { 20 cin >> playNum; 21 cout > playNum; 25 cout > playNum; 29 cout > playNum; 33 cout > playNum; 35 } 36 37 38 return; 26 39) 40

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!