Question: Language: C++ This is the program that it needs to be based off of: Modify the existing pet interaction functions (feed) and play)) to also
Language: C++

This is the program that it needs to be based off of:


Modify the existing pet interaction functions (feed) and play)) to also change this value. For example, if the new data is money feeding the pet costs money (for food), but playing with the pet gains money (your pet is doing tricks for tips). Or if your new data is sleepy then both feeding and playing with your pet makes it sleepier Add a new interaction function (like feed and play) that allows users to interact with the pet in a new way that affects all of the current data For example, if you added a sleepy data member, then there should be a nap) function that reduces sleepy, but increases hungry. Make sure to include this new interaction in the player menu so the player can select it Remember to add your new data member to the pet printo function so it tells the player how sleepy their pet is, or how much money they have left, etc Add a new random event function that is called after the player interacts with the pet ie. at the end of the main loop. This function should have a chance of one of several random events occurring (and a large chance that no random event occurs). Random events should print a message to the player telling them what the event was and should affect the member data of the pet. You should make up your own random events. Examples would be "Your pet found a bone happiness goes up and hunger goes down or "Your pet escaped from the backyard and was caught by animal control." happiness goes up, money (if you created it) goes down or "Your pet found a skunk." happiness goes way down One way to implement the random event function is to generate a random number in some range (e g.0-9) and use a switch statement to determine the outcome. Many of the switch cases can default to no event, and a few of the cases can call functions with the special events
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
