Question
For this project, you get to design a simple program to keep track of various video game characters. Your program will store, display and remove
For this project, you get to design a simple program to keep track of various video game characters. Your program will store, display and remove human characters, enemy characters and enemy "boss" characters. Additionally, your program will display all of the characters that have been added (that have not been removed). Present the user with the following menu of options:
Options: 1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
If the user does not enter one of these options, then display: Sorry, is not a valid option. Where is the user's input.
All characters have the following:
- A name (String, you can assume that for this project, there will be no spaces in the name of each character)
- Max health (real number)
- Remaining health (real number)
In addition to everything that a character has, a human character also has:
- Coins (whole number)
In addition to everything that a character has, an enemy boss character also has:
- Number of lives left (whole number)
To display or remove a single character, have the user just request the name (you can assume that there will be no spaces in any of the names in this project). To increase or decrease a character's remaining health, have the user first specify the name, then the health amount to add or subtract. For this project, you can assume that only valid input will be given. This does NOT mean that the user can not request a character that does not exist. If the character is not in the list, then display: Sorry, could not find in the list. Where is the user's input. When displaying all of the characters, display them in the order that they were entered. Note, for increasing and decreasing a character's remaining health, verify that that the specified character is in the list before requesting the amount.
For this project, you get to have a separate class for the human, enemy and enemy boss characters. Store each class in a separate file. Furthermore, they should be organized into an inheritance hierarchy. You can use an abstract class if you want to.
Additionally, have a driver class named VideoGameCharManager. Store all of the character objects in a single ArrayList in this class. Create the ArrayList in the main() method of your VideoGameCharManager class. You are not allowed to explicitly use the Object class anywhere in your VideoGameCharManager class (meaning, you should not have "Object" anywhere in your code in VideoGameCharManager.java).
Only ask for input in your VideoGameCharManager class. Only display output in your VideoGameCharManager class.
Examples
Note, user input is in bold face blue and underlined text is required for test cases.
Add Three and List Example
Welcome to your VideoGameChar Manager to store all of the video game characters Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 3
You entered: 3
Please enter the name of the enemy boss character: Bowser
You entered: Bowser
Please enter Bowser's max health: 150.0
You entered: 150.0
Please enter Bowser's remaining health: 123.45
You entered: 123.45
Please enter the number of lives for the enemy boss: 3
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 2
You entered: 2
Please enter the name of the enemy character: Goomba
You entered: Goomba
Please enter Goomba's max health: 10.0
You entered: 10.0
Please enter Goomba's remaining health: 7.89
You entered: 7.89
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 1
You entered: 1
Please enter the name of the human character: Mario
You entered: Mario
Please enter Mario's max health: 100.0
You entered: 100.0
Please enter Mario's remaining health: 100.0
You entered: 100.0
Please enter the number of coins for Mario: 15
You entered: 15
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 3 characters:
Enemy Boss Bowser: 123.5 out of 150.0 health or 82.3% and 3 lives left
Enemy Goomba: 7.9 out of 10.0 health or 78.9%
Human Mario: 100.0 out of 100.0 health or 100.0% and 15 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 9
You entered: 9 Good-bye!
Example B
Welcome to your VideoGameChar Manager to store all of the video game characters
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 3
You entered: 3
Please enter the name of the enemy boss character: Bowser
You entered: Bowser
Please enter Bowser's max health: 150.0
You entered: 150.0
Please enter Bowser's remaining health: 98.765
You entered: 98.765
Please enter the number of lives for the enemy boss: 3
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 2
You entered: 2
Please enter the name of the enemy character: Goomba
You entered: Goomba
Please enter Goomba's max health: 10.0
You entered: 10.0
Please enter Goomba's remaining health: 9.876
You entered: 9.876
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 2
You entered: 2
Please enter the name of the enemy character: Koopa
You entered: Koopa Please enter Koopa's max health: 20.0
You entered: 20.0
Please enter Koopa's remaining health: 15.67
You entered: 15.67
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 1
You entered: 1
Please enter the name of the human character: Mario
You entered: Mario
Please enter Mario's max health: 100.0
You entered: 100.0
Please enter Mario's remaining health: 100.0
You entered: 100.0
Please enter the number of coins for Mario: 99
You entered: 99
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 1
You entered: 1
Please enter the name of the human character: Luigi
You entered: Luigi
Please enter Luigi's max health: 100.0
You entered: 100.0
Please enter Luigi's remaining health: 97.543
You entered: 97.543
Please enter the number of coins for Luigi: 16
You entered: 16
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 1
You entered: 1
Please enter the name of the human character: Toad
You entered: Toad
Please enter Toad's max health: 100.0
You entered: 100.0
Please enter Toad's remaining health: 78.92
You entered: 78.92
Please enter the number of coins for Toad: 17
You entered: 17
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 6 characters:
Enemy Boss Bowser: 98.8 out of 150.0 health or 65.8% and 3 lives left
Enemy Goomba: 9.9 out of 10.0 health or 98.8% Enemy Koopa: 15.7 out of 20.0 health or 78.4%
Human Mario: 100.0 out of 100.0 health or 100.0% and 99 coins
Human Luigi: 97.5 out of 100.0 health or 97.5% and 16 coins
Human Toad: 78.9 out of 100.0 health or 78.9% and 17 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 4
You entered: 4
Please enter the name of the character to display: Goomba
You entered: Goomba
Enemy Goomba: 9.9 out of 10.0 health or 98.8%
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 6 characters:
Enemy Boss Bowser: 98.8 out of 150.0 health or 65.8% and 3 lives left
Enemy Goomba: 9.9 out of 10.0 health or 98.8%
Enemy Koopa: 15.7 out of 20.0 health or 78.4%
Human Mario: 100.0 out of 100.0 health or 100.0% and 99 coins
Human Luigi: 97.5 out of 100.0 health or 97.5% and 16 coins
Human Toad: 78.9 out of 100.0 health or 78.9% and 17 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 6
You entered: 6
Please enter the name of the character to remove: Goomba
You entered: Goomba
Removing:
Enemy Goomba: 9.9 out of 10.0 health or 98.8%
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 5 characters:
Enemy Boss Bowser: 98.8 out of 150.0 health or 65.8% and 3 lives left
Enemy Koopa: 15.7 out of 20.0 health or 78.4%
Human Mario: 100.0 out of 100.0 health or 100.0% and 99 coins
Human Luigi: 97.5 out of 100.0 health or 97.5% and 16 coins
Human Toad: 78.9 out of 100.0 health or 78.9% and 17 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 6
You entered: 6
Please enter the name of the character to remove: Bowser
You entered: Bowser
Removing:
Enemy Boss Bowser: 98.8 out of 150.0 health or 65.8% and 3 lives left
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 4 characters:
Enemy Koopa: 15.7 out of 20.0 health or 78.4%
Human Mario: 100.0 out of 100.0 health or 100.0% and 99 coins
Human Luigi: 97.5 out of 100.0 health or 97.5% and 16 coins
Human Toad: 78.9 out of 100.0 health or 78.9% and 17 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 6
You entered: 6
Please enter the name of the character to remove: Mario
You entered: Mario
Removing:
Human Mario: 100.0 out of 100.0 health or 100.0% and 99 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 8
You entered: 8
Please enter the name of the character to decrease health: Bowser
You entered: Bowser
Sorry, could not find Bowser in the list
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 8
You entered: 8
Please enter the name of the character to decrease health: Bowser
You entered: Bowser
Sorry, could not find Bowser in the list
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 6
You entered: 6
Please enter the name of the character to remove: Mario
You entered: Mario
Sorry, could not find Mario in the list
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 8
You entered: 8
Please enter the name of the character to decrease health: Toad
You entered: Toad
Please enter the amount to decrease Toad's health: 0.45 You entered: 0.45
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 8
You entered: 8
Please enter the name of the character to decrease health: Bowser
You entered: Bowser
Sorry, could not find Bowser in the list
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 7
You entered: 7
Please enter the name of the character to increase health: Toad
You entered: Toad
Please enter the amount to increase Toad's health: 3.45
You entered: 3.45
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 5
You entered: 5
Displaying 3 characters:
Enemy Koopa: 15.7 out of 20.0 health or 78.4%
Human Luigi: 97.5 out of 100.0 health or 97.5% and 16 coins
Human Toad: 81.9 out of 100.0 health or 81.9% and 17 coins
Options:
1) Add a human character
2) Add an enemy character
3) Add an enemy boss character
4) Display a character
5) Display all characters
6) Remove a character
7) Increase a character's health
8) Decrease a character's health
9) Quit
Please choose from the above options: 9 You entered: 9 Good-bye!
Step by Step Solution
3.47 Rating (147 Votes )
There are 3 Steps involved in it
Step: 1
Characterjava Abstract Class This class acts as the foundation for all character types Human Enemy EnemyBoss It will have the following attributes name String The name of the character no spaces allow...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started