Description
Overview
A Tokimon is a rare creature found in the remote areas of Korea. For the most part, they
resemble rabbits and the only form of communication they have with us is the ability to say
their own name. Tokimons come in all shapes and sizes, have special abilities, and tend to fight
with each other on occasion. Each Tokimon has a type which gives them the ability to fly,
throw fire, spray water, electrify, and freeze (other Tokimons); each Tokimon has a strength
measured by an integer between 0 and 100. Because they are such primitive creatures but have
such extraordinary abilities, they must be tracked. We would like to write an application to
track the characteristics of the less than 300 Tokimons in existence today.
Text Interface: your app should have the following general options to choose from:
1. List all Tokimons including the name, type, height, weight, and abilities
2. Add a new Tokimon. Prompt the user for a name, type, height, weight, and abilities.
3. Delete a Tokimon. First list all current Tokimons, allow the user to choose the Tokimon
to delete (or 0 to cancel). Entering an invalid number should be handled by the
program, but invalid datatypes such as ‘A’ need not be handled.
4. Augment ability. First list all current Tokimons, allow the user to choose the Tokimon to
increase the ability, the type of ability, then prompt for the amount. Once again, you do
not need to handle invalid datatypes.
5. Display the toString() on each Tokimon in the system.
6. Exit the program.
Technical requirements:
– Write a function called displayMainMenu()
– Write a function called displayAllTokis()
– Write a function called addNewToki()
– Write a function called deleteToki()
– Write a function called alterToki()
This may give some intuition to a good design for this assignment.
Here is some sample output, you do not have to match the exact layout (it’s just a
suggestion):
********************************************
* Tokimon Tracker by Bobby Chan sn 5555555 *
********************************************
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 2
Enter Tokimon’s name: Toki chu
Enter Tokimon’s type: Fire
Enter Tokimon’s size: .5
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 1
*********************
* List of Tokimons: *
*********************
1. Toki chu, 0.5m, Fire ability, 0 strength
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 2
Enter Tokimon’s name: Squir To
Enter Tokimon’s type: Water
Enter Tokimon’s size: 3.1
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 1
*********************
* List of Tokimons: *
*********************
1. Toki chu, 0.5m, Fire ability, 0 strength
2. Squir To, 3.1m, Water abiity, 0 strength
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 5
All Tokimon objects:
1. ca.sfu.cmpt213.as1.Tokimon[Name:Toki chu, Strength:0, Height:0.5, Ability:Fire]
2. ca.sfu.cmpt213.as1.Tokimon[Name:Squir To, Strength:0, Height:3.1, Ability:Water]
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 4
*********************
* List of Tokimons: *
*********************
1. Toki chu, 0.5m, Fire ability, 0 strength
2. Squir To, 3.1m, Water abiity, 0 strength
(Enter 0 to cancel)
> 1
By how much?: 3
Toki chu now has strength 3!
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 4
*********************
* List of Tokimons: *
*********************
1. Toki chu, 0.5m, Fire ability, 0 strength
2. Squir To, 3.1m, Water abiity, 0 strength
(Enter 0 to cancel)
> 0
*************
* Main Menu *
*************
1. List Tokimons
2. Add a new Tokimon
3. Remove a Tokimon
4. Change Tokimon strength
5. DEBUG: Dump objects (toString)
6. Exit
> 6
BYE!
You may assume any requirements that are not explicitly stated in this description (within
reason). If you’re not sure of a requirement, please see the TAs or myself.
Marking Scheme:
[20] Basic Functionality
[5] Robust keyboard input: when given a number out of range it asks for retry.
(Not testing typing text, like “A”, instead of a number).
[5] Able to add and remove Tokimons.
[5] Able to augment strengths correctly.
[5] Good listing of Tokimons, and debug listing (using toString).
[8] Code Quality and Style Guide
* Reasonable object oriented structure (one class likely is not enough)
* JavaDoc comment on each class (not needed on methods/fields)
* Correct indentation, brackets, spacing (use IDE’s reformat if needed).
* Good intention revealing class, method, and variable names.
Submission
Submit a zip file of your project (according to the directions outlined in the assignments link of
the course website) to the coursys server. https://courses.cs.sfu.ca/
Please note: all submissions are automatically checked for similarities of all other submissions on
the server.
THE END