Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PLZ 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

image text in transcribedC++ PLZ

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 horse For coding simplicity, follow each output animal by a space, even the last one. Hint: To make testing easier, seed your random number generator with 0 . Also, try to execute one iteration of the game before you repeat the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions

Question

Is short-selling good for the stock markets?

Answered: 1 week ago