Question: Must contain Main.cpp and Grasshopper.h file. Thank you. Objectives To strengthen student's knowledge of C++ programming To give student experience in writing Object Oriented code

 Must contain Main.cpp and Grasshopper.h file. Thank you. Objectives To strengthenstudent's knowledge of C++ programming To give student experience in writing ObjectOriented code Background Digital grasshoppers are very hungry and very greedy; ifthere is any room in their stomach, a digital grasshopper will attempt

Must contain Main.cpp and Grasshopper.h file. Thank you.

Objectives To strengthen student's knowledge of C++ programming To give student experience in writing Object Oriented code Background Digital grasshoppers are very hungry and very greedy; if there is any room in their stomach, a digital grasshopper will attempt to eat just about anything that is nearby. Most digital grasshoppers prefer grass, seeds, and bugs. Digital grasshoppers are also fussy eaters; if they are unable to completely consume an object, they spit it back up completely Digital grasshoppers are very rarely satisfied with their last meal; they can empty the contents of their stomachs in two ways: 1. they can vomit the last meal they consumed at potential threats or just to make room 2. they can excrete the oldest meal still in their stomach to make room as well. Digital grasshoppers can be trained to perform any of the above actions on command. Instructions Write a program that allows a user to issue a series of instructions to a digital grasshopper and reports on the grasshopper's responses and status. Your program must model the following behaviors Train - creates a new digital grasshopper of the indicated. This will delete the previous digital grasshopper, so it should warn the user and ask them to commit before continuing. 1. 2. Eat - the grasshopper attempts to eat the indicated . Should indicate whether it successfully ate the item or not. 3. Excrete - remove the oldest item the grasshopper has eaten from its stomach. Should indicate which item was excreted or if the stomach was empty. 4. Vomit remove the newest item the grasshopper has eaten from its stomach. Should indicate which item was vomited or if the stomach was empty. Report-list the contents of the grasshopper's stomach, then output HUNGRY if the grasshopper's stomach is empty or FULL if the grasshopper's stomach is full 5

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!