Description

You have decided to create a game where you take care of magical creatures, called Hokeemon. Furthermore, you will need to imple- ment behaviors listed below:

  • Listen - Have your creature tell you it's current hunger and bore- dom states.
  • Play - Play with your creature to reduce boredom by a random number between 4-8. Minimum: no minimum. Maximum: 20.
  • Feed - Feed your creature to reduce hunger by a random number between 3-6. Minimum: 0. Maximum: no maximum.

Program Elements

1. Use a constructor to initialize hunger and boredom to random numbers between 0 - 5.

2. If boredom exceeds 20, your hokeemon will slip into an unre- sponsive catatonic state. Each turn you aren't playing with your Hokeemon increases this by 1.

3. If hunger drops below 0, your Hokeemon will die of starvation! Each turn decreases hunger by 1.

Requirements

  • No C libraries (no .h).
  • No global variables or analogues of global variables.
  • No standard template library anything.
  • Create a alphabetic menu to handle program options.
  • Only allow valid letters or symbols as input for this menu. Upper and lower case if appropriate. Re-prompt in event of error.
  • Create at least 1 object.
  • All objects must have a component testing method which runs at least 2 diagnostic tests on that object. This is called from the unit test function (next element).
  • Create a unit test function which calls the component tests on all objects. Include this in main() right after the program greeting.
  • Don't forget to put a header on your source file.
  • In your program greeting function, be sure to display the current date. Get this from the system hardware.
  • No compiler warnings.

Specifications

// Specification C1 - PassTime()

You will need to implement a PassTime() method which will in- crease hunger and boredom by 1. This will be called after Listen, Play or Feed.

// Specification C2 - Creature class

Create a creature class which you will use to instantiate your Ho- keemon.

// Specification C3 - Validate Input

This is a menu driven program. Create a alphabetic menu which will allow you to select Listen, Play, Feed, or Quit. Do not accept any other options (unless you build those options into the game).

// Specification C4 - Overload <<

Overload the << operator to display diagnostic information on your Hokeemon.

// Specification B1 - Child Class

Create a child class which you actually play the game with. The Creature class from C2 will now become the parent class. Make sure you give your Hokeemon an appropriate species name.

// Specification B2 - Virtual Class Creature

Turn Creature into an abstract base class, so you cannot instan- tiate it. Play with the child classes. Make sure the ABC has all common Hokeemon features.

//Specification B3 - Overload Assignment Operator

Overload the assignment operator so you can assign Hokeemon feature scores to other Hokeemon. If you don't need this in your game, you can always use it in your component test method.

//Specification B4 - Overload + Operator

This allows you to produce a 3rd Hokeemon by merging 2 other Hokeemon. The resulting instance has features from both parents. I'll leave it to you to decide how exactly you want to do that.

// Specification A1 - Critter Name

Allow the human to name their newly created Hokeemon. Yes, this is a giveme.

// Specification A2 - Copy Constructor

Decide how you want to handle these in your classes and code accordingly. Whatever you decide to do with this, comment it in your code with your design rational.

// Specification A3 - Second Child Class

Implement a second, different, child class. You can choose which class to play with or play with both of them!

// Specification A4 - Write a Lambda

Use a Lambda function somewhere in your code. Like Spec B3, you can always write it just to be called from your component test method (but don't put it in your component test method).

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.