Homework 6

Due: November 5th, 2021 12:00pm


For this assignment, you will submit multiple C++ compilable files containing a program written in C++. For every function, you must have the proper function documentation as well! We suggest (strongly) that you make a directory for every assignment! Name your file a meaningful name and give it a .cpp extension since you will be compiling it. Also, make sure that you compile and run your program using the GNU (g++) compiler before submitting to make sure that it will work.

Background

Time flies, you all have been studying in the Codémon Academy for some time now. You have laughed so hard and also cried so much. The once strangers have now become your best friends in supporting your daily challenge of the learning and conquering of different amazing Codémons (though there are some that you are not really fond of...) Long story short, now is the time to have some fun away from the academy. And what’s better than engaging in a game to combat against your best friends and peers?!

Program Spcifications

In your program, you will create different “classes” in order to simulate the game that’s about to be described (either in this assignment or the next one).

Contestant Class

The Codemon Class

The Item Class

Skills Class

Friend Functions

Program Flow

Once all of the classes and relevant functions have been properly set up, your main program should then test their correctness in order to make sure that the actual tournament and combat can happen without any major hiccups. Some suggestions that you could try:

Notes

  1. It is your responsibility to determine whether each data member (including function) should be public or private. So think carefully in order to create a proper interface for your classes while ensuring sufficient data encapsulation.
  2. Besides the specified data members stated in the requirements, feel free to create additional member variables and/or member functions as you see fit

Sample Output

Sample Output

What's your name, contestant?
Tammy Casey
What's your name, contestant?
Kari Morton
What's your name, contestant?
Leo Thompson

Let's prepare you for the combat, contestant Tammy Casey!
Do you want to add a new Codemon? (y/n)
y
Name of the Codemon?
Pikachu
The Codemon's type?
Electric
The Codemon's level?
25
The Codemon's HP?
300
Do you want to add a new skill for this Codemon? (y/n)
y
Name of the skill?
Static
The skill's base damage?
26
Do you want to add a new skill for this Codemon? (y/n)
n
Do you want to add a new Codemon? (y/n)
n
Do you want to add a new item? (y/n)
n

Let's prepare you for the combat, contestant Kari Morton!
Do you want to add a new Codemon? (y/n)
y
Name of the Codemon?
Raichu
The Codemon's type?
Electric
The Codemon's level?
30
The Codemon's HP?
400
Do you want to add a new skill for this Codemon? (y/n)
y
Name of the skill?
Static
The skill's base damage?
26
Do you want to add a new skill for this Codemon? (y/n)
n
Do you want to add a new Codemon? (y/n)
n
Do you want to add a new item? (y/n)
n

Let's prepare you for the combat, contestant Leo Thompson!
Do you want to add a new Codemon? (y/n)
y
Name of the Codemon?
Electrode
The Codemon's type?
Electric
The Codemon's level?
100
The Codemon's HP?
40
Do you want to add a new skill for this Codemon? (y/n)
y
Name of the skill?
Static
The skill's base damage?
26
Do you want to add a new skill for this Codemon? (y/n)
y
Name of the skill?
Soundproof
The skill's base damage?
5
Do you want to add a new skill for this Codemon? (y/n)
n
Do you want to add a new Codemon? (y/n)
n
Do you want to add a new item? (y/n)
y
Name of the item?
Blue Apricorn
Purpose of the item?
A general food item
Duration effect of the item?
30
Do you want to add a new item? (y/n)
n

Contestant Summary:
Contestant name: Tammy Casey
Number of Codemons owned: 1
Pocket list:
     1) Pikachu

Contestant name: Kari Morton
Number of Codemons owned: 1
Pocket list:
     1) Raichu

Contestant name: Leo Thompson
Number of Codemons owned: 1
Pocket list:
     1) Electrode
Backpack list:
     1) Blue Apricorn

Hello, do you want to look up a skill? (y/n)
y
What skill do you want to look up?
Static
Skill name: Static
Base damage: 26
Acquired by:
     1) Pikachu (Tammy Casey)
     2) Raichu (Kari Morton)
     3) Electrode (Leo Thompson)
Hello, do you want to look up a skill? (y/n)
y
What skill do you want to look up?
Soundproof
Skill name: Soundproof
Base damage: 5
Acquired by:
     1) Electrode (Leo Thompson)
Hello, do you want to look up a skill? (y/n)
y
What skill do you want to look up?
Thunderbolt
Sorry, there's currently no available info about this skill. 
Hello, do you want to look up a skill? (y/n)
n

Good bye, the combat shall begin soon!