Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Just do what you can please arefully In this assignment, create Tekemon.java, Icemon.java and Firemon.java that will simulate two different types of Tekemon fighting. Therefore,

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Just do what you can please image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
arefully In this assignment, create Tekemon.java, Icemon.java and Firemon.java that will simulate two different types of Tekemon fighting. Therefore, you can also create a Wreckright.java that will be used for testing purposes and will not be turned in to us. To complete this assignment, you will use your knowledge of class hierarchies, method overriding, and abstract classes. Remember to test for Checkstyle Errors and indude Javadoc Comments! Solution Description You will create one abstract class, Tekemon.java, and two classes. Hint: A lot of the code you will write for this assignment can be reused. Try to think of what keywords you can use that will help you! Tekemon.java This class represents a generic Tekemon. You must not be able to create an Instance of this class (Hint: there is a keyword that prevents us from creating instances of a class), Variables Variables must be not allowed to be directly modified outside the class in which they are declared, unless otherwise stated in the description of the variable. Hint there is a specific visibility modifier that can do this! The Tekemon class must have these variables. . . name.. the name of the Tekemon which can be made of any combination of characters level the amount of experience a Tekemon has as an int stamina the health of the Tekemon as an Int keyworu prevenSUSTUSSUECESS Variables Variables must be not allowed to be directly modified outside the class in which they are declared, unless otherwise stated in the description of the variable. Hint: there is a specific visibility modifier that can do this! The Tekemon class must have these variables. name - the name of the Tekemon, which can be made of any combination of characters level - the amount of experience a Tekemon has as an int stamina - the health of the Tekemon as an int . . . Constructors . A constructor that takes in the name, level, and stamina in this specific order. The constructor sets these variables accordingly. You should not have any other constructors. Make sure that stamina is not below. If stamina is a negative number, set it to 0. Methods Do not create any other methods than those specified. Any extra methods will result in point deductions. All methods must have the proper visibility to be used where it is specified duel (Tekemon t) Method that challenges another Tekemon to a battle. Any concrete class that extends the Tekemon's class must provide a method definition. Does not return anything potion O . o . Increases stamina by 15 points. Does not return anything, levelUp() Method that provides the ability for a Tekemon to level up based on certain conditions. Any concrete class that extends the Tekemon's class must provide a method definition. The method does not return anything, equals(Object o) Two Tekemons are equal if they have the same name, level, and stamina. Must override equals() method defined in Object class toString() - returns a String describing the Tekemon as follows: "My name is [name], and I am a Tekemon. My level is [level] and my current stamina is (stamina)." Note: replace the values in brackets (1 with the actual value Getters and setters as necessary. . Icemon.java This file defines an Icemon. An Icemon is a Tekemon and should have all attributes of one. (HINT: There is a specific keyword found in L12). Variables All variables must be not allowed to be directly modified outside the class in which they are declared unless otherwise stated in the description of the variable. Hint: there is a specific visibility modifier that can do this! The Icemon class must have these variables. Do NOT re-declare any of the instance variables declared in Tekemon class: . pet - whether the icemon owns a pet, represented by a boolean icemonSize - the total number of icemons represented by an int. This should be incremented each time a icemon is created Note: this value should be the same for all icemon objects. icepoints - the total amount of points the Icemon has earned represented by an int. Constructors A constructor that takes in the name, level, stamina, pet, and icepoints and sets all fields accordingly. It must accept the variables in the specified order. Hint: There is a specified keyword in L12 to access the superclass's constructor A constructor that takes in just a name and assigns the following default values: level: 15 stamina: 100 pets true icePoints: e icePoints - the total amount of points the Icemon has earned represented by an int. Constructors . o . A constructor that takes in the name, level, stamina, pet, and icepoints and sets all fields accordingly. It must accept the variables in the specified order. Hint: There is a specified keyword in L12 to access the superclass's constructor. A constructor that takes in just a name and assigns the following default values: level: 15 stamina: 100 pet: true icePoints: 0 O O O O Methods Do not create any other methods than those specified. Any extra methods will result in point deductions. All methods must have the proper visibility to be used where it is specified. . o - duel (Tekemon t) Should override the duel O method declared in the Tekemon superclass if the target Tekemon is another Icemon, they also cannot duel. Print "Cannot duel an ally!" If either the Tekemon's or the opponent's stamina is 0, they cannot duel. Print "Cannot duel! Otherwise, decrease the target Tekemon's stamina by two times the icemon's level If the stamina of the Tekemon falls below 0, set their stamina to O The opponent is defeated once their stamina drops to O If the opponent is defeated, the icemon earns icepoints that is equal to half of the opponent's level Call levelUp() each time if the opponent is defeated in case the Icemon can move up a level This method should not return anything 3 . O O levelUp() Should override the levelUp () method declared in the Tekemon superclass. If the Icemon level is greater than or equal to 20, then the amount of icePoints required to move up by 1 level is 30 icePoints. Otherwise, if the Icemon level is below 20, then the amount of icePoints required to move up by 1 level is 20 icePoints. Once moving the icemon up by 1 level, the icePoints variable should be reset. Any additional points remaining that carry beyond the minimum (20/30 icePoints) should be added back to the icePoints total Afterwards, print Yay, I am now level [level]!" Repeat the above steps until the Icemon is no longer able to levelup, printing the statement above multiple times if the Icemon levels up multiple times. This method should not return anything, 0 . . . o o o . E 18. iceWreck() An Icemon always finds strength in numbers! With this special move, they can power up their level based on the number of allies! Increases the icePoints of the Icemon based off the icemonSize For the given amount of Icemon allies, increase the icePoints of the Icemon the method is called on by 10% for each icemon (check example below for clarity) and round the number of icePoints down to the nearest integer (i.e. icepoints (8.9 -> 8.0)) Example: If icemonSize is 3, the icePoints of the Icemon increases by 30% Example 2: If icemonSize is 11, the icePoints of the Icemon increases by 110% This method should not return anything. brainfreeze Icemon's specialty lies within their brains and wits. With this special move, Icemon can use their stamina to literally project icicles from their eyes! When this method is called, icicles are produced to increase stamina. Increase stamina by the current icePoints divided by two. The Icicles are not produced without a cost though. The Tekemon's own icepoints is decreased by 5 each time the move is used. If icepoints falls below 0, set it to 0. If the icepoints is below 5. the icemon should not be able to perform brainfreeze This method does not return anything. equals(Object o) - this method must override Tekemon's equasi) method o . o Two Icemons are equal if they both have the same name, level, stamina, and the same value for pet. . You must use the equals() method from the Tekemon class to receive full credit. toString() - returns a String describing the Icemon as follows: (Note: replace the values in brackets I) with the actual value) "My name is [name], and I am a Tekemon. My level is [level] and my current stamina is [stamina]. I am a Icemon, and I [have / do not have] a pet." You must use the toString) method from the Tekemon class to receive full credit. Getters and Setters as necessary. . Firemon.java This file defines an Firemon. A Firemon is a Tekemon and should have all attributes of one. (HINT: There is a specific keyword found in 112). Variables All variables must be not allowed to be directly modified outside the class in which they are declared, unless otherwise stated in the description of the variable. Hint: there is a specific visibility modifier that can do this! The Firemon class must have these variables. Do NOT redeclare any instance variables created in the Tekemon class knowledgeLevel the knowledge level of the Firemon represented by an integer firePoints - the total amount of points the Firemon has earned represented by an Integer . Constructors . . A constructor that takes in the name level, stamina, knowledgelevel, and firePoints and sets all fields accordingly. It must accept the variables in the specified order. A constructor that takes in just a name and assigns the following default values level: 30 stamina: 20 knowledgeLevel 30 fire Points: 0 D epluie Val in the specified order. A constructor that takes in just a name and assigns the following default values: level: 30 O stamina: 20 knowledgeLevel: 30 O firePoints: 0 O Methods Do not create any other methods than those specified. Any extra methods will result in point deductions. All methods must have the proper visibility to be used where it is specified. . D duel (Tekemon t) Should override the duel() method declared in the Tekemon superclass. If either the Firemon's or the Tekemon's stamina is o, they cannot duel. If the target Tekemon is another Firemon, they also cannot duel. Print "Cannot duel an ally!" Otherwise, the Firemon now begins their attack. If a Firemon's knowledgelevel is above a 13, pick a random integer between 1 and 10 inclusive. If the number is odd, call fire Fight(). If the Firemon's knowledgeLevel is 13 or below, do nothing. - . Decrease the targetted Tekemon's stamina by 15+ (half the Firemon's level (floored)) If the starina of the Tekemon falls below 0, set their stamina to 0 The opponent is defeated once their stamina drops to 0 After defeating the opponent, the Firemon earns firePoints equal to half of the opponent's level (round down to the nearest int) Call levelUp() each time if the opponent is defeated in case the Firemon can move up a level Does not return anything fire Fight() If the Firemon's stamina is greater than 25, they can play firefight Add 20 points to firePoints if the Firemon's knowledgeLevel is greater than or equal to 30 Add only 10 to firePoints if their knowledge levelis less than 30 After playing fire Fight, print "We won the fight, yay!" Call levelUp to check the status. This method should not return anything . . O o o O After playing firefight prime we won the night yay! Call levelUp() to check the status, This method should not return anything levelUp Should override the levelUp O method declared in the Tekemon superclass If the Firemon's level is greater than or equal to 30, then the amount of firePoints required to move up by 1 level is 40 firePoints. Otherwise, if the firemon level is below 30, then the amount of firePoints required to move up by 1 level is 20 firePoints. Once moving the Firemon up by 1 level, the firePoints variable should be reset to 0. Any additional points remaining that carry beyond the minimum should be added bac to the firePoints total Afterwards, print "Yay, I am now level [level]!" Repeat the above steps until the Firemon is no longer able to levelUp, printing the statement multiple times if the Firemon levels up multiple times. This method should not return anything. equals(Object o) - this method must override Tekemon's equals() method Two Firemons are equal if they have the same name, level, stamina, and knowledgeLevel. You must use the equals() method from the Tekemon's class to receive full credit. toString() - returns a String describing the Firemon as follows: (Note: replace the values in brackets II with the actual value) **My name is [name], and I am a Tekemon. My level is [level] and my current stamina is (stamina]. am a Firemon, and I have [knowledge Level] knowledge. You must use the toString method from the Tekemon class to receive full credit. Getters and Setters as necessary . . Getters and Setters as necessary. WreckFight.java This Java file is a driver, meaning it will contain and run Icemon and Firemon objects and drive their values according to a simulated set of actions. This is just to show an example of object implementation to see how objects interact with each other. Feel free to play around with different values and method callings! This file will NOT be turned in. o Create two Icemons A lcemon with the following values name: Edward Cullen level: 101 stamina: 50 pet: false icePoints: 0 Alcemon with just the passed in name: "Dedric Ciggory" Create two Firemon A Firemon with the following values name: Stan Loona level: 16 stamina: 12 knowledgeLevel: 45 firePoints: 0 A Firemon with just the passed in name: "Cho Cheng . . CIVILS, U . A Firemon with just the passed in name: "Cho Cheng Perform the following method calls Print the "Edward Cullen" object with toString(). Print the "Dedric Ciggory" object with toString(). Print the "Cho Cheng" object with toString(). Print the "Stan Loona" object with toString(). Have Edward Cullen duel Cho Cheng. Edward Cullen drinks potion Dedric Diggory duels Stan Loona Print the "Edward Cullen" object with toStringo. Print the "Dedric Ciggory" object with toString(). Print the "Cho Cheng object with toString(). Print the "Stan Loona' object with toString). o o o o o o o Reuse your code when possible. Certain methods can be reused using certain keywords. If you use the @Override tag for a method, you will not have to write the lavadocs for that method. These tests and the ones on Gradescope are by no means comprehensive so be sure to create your own! CIVILS, U . A Firemon with just the passed in name: "Cho Cheng Perform the following method calls Print the "Edward Cullen" object with toString(). Print the "Dedric Ciggory" object with toString(). Print the "Cho Cheng" object with toString(). Print the "Stan Loona" object with toString(). Have Edward Cullen duel Cho Cheng. Edward Cullen drinks potion Dedric Diggory duels Stan Loona Print the "Edward Cullen" object with toStringo. Print the "Dedric Ciggory" object with toString(). Print the "Cho Cheng object with toString(). Print the "Stan Loona' object with toString). o o o o o o o Reuse your code when possible. Certain methods can be reused using certain keywords. If you use the @Override tag for a method, you will not have to write the lavadocs for that method. These tests and the ones on Gradescope are by no means comprehensive so be sure to create your own! Homework 05 - Let's Play with Tekemon Problem Description Hello! Please make sure to read all parts of this document care Tekemon sighting. Therefore, you can to Wrest will be doing and not be turned into us to completament, you will use you can do evening and strate Remember to test for Chedstyle Errors and indute de comments Solution Description You will create one stract client Teeson, Swedbo Hint Akt of the code you will woment can be ready what you can that will help you Tekemon.java This claus represents a peneric tekementet bestile createnente keyword that prevents from creating ancesto Variaties must be not allowed to be directly modified outside the continuer declarat here the description of the variable interesa specific The Tekenen mit have sets name the name of Tekenen, which can be made on cool characters level the amount of experience Tekemon has as it Constructor Actes in the levelse. The con these variables accordingly. You should not have any constructors Males belowstania september sett Methods Do ne Areat any Hermut ase Secret Anven methodalEnesiapse detectons A Metodat halenges the Tekemon tea butte. As concrete asetes the Teemen's classideato in Dunything potion Increase stamina by 15 point Calendar To Do Notifications Inbox Does not returning levelup() Method that provides the ability for a tokemon salon condition Any concrete as that conse Tener's ca mult pro The method does not return anything quisoject) Two Tetenons are equal if they have the same name levels Must overde equal method defined in Object .tostring() retures Sving describing the elemento My name is name, and 1. Teremon. my love is [level] and my current stain is (staina). No replace the values in bracket with the actual Getters and has necessary Iceton.java The te defines temen. An cementa Tetemen and should nevestone HINT. There's a specific keyword found in 12 Al variables must be not allowed to be directly modified ide the chin which they are therehe stated the desertion of the content there is what The kemon must have these are Do NOT decor any of the instances declared in een pet.whether the ceman outsa petraremba bola Sire the total number of red by The come created the same for . icepoints the totalment of points the emocredere Constructors A constructor that takes in the name level stamina, petits caringly. It must accept the variables in the specified order Port There is a specified keyword into a superlusco Aconductor that staan de wind stania: 100 petite Points Methode Do not create any termete these specified nyerere methods must have the properability to be red where it is specified Calendar To Do Notifications Inbox uel (Teknon) Should we hadden er the twget Temen hemen alt annet duel an ally" Wher the terms and Print "Cannot du Otherwise, decreme the target om by westecemos level We starina of the Telementele set their staina to The opponents de cette in the sono contesto hat of the opponents devel Collectie de ince the cement level Should werd een were the came level 20 then the out of centret Nove up tv scts Oherwhelmen ve bent of controved to move One moving to be consideret Any additional points carry beyond the minimum 120/80 cents should be back to the scents Array, low level level]!" Repeat the sense toering the went beve multiple times time Sw) Antoemon was finestres meve, they can powerpte relbed on the roles! here the most of them all the centre For the names of more points of the month metho cated on by som for each emocraw or criand round the number of Pits owners (1) Dangle com seu by sos . mot.ints of the more by 1105 braintreeze Remon's eyes www cal move, kamen can use the When this method cared to retain amina by the currents died by The se ne produced without there's a Points decreased by See the wints below the teints de soldat beste te perform traire The methodol D Calendar To Do Notifications Inbox Two demonstre squali il they both have the same name level stains, and the same for pet You must use the equat method from the Tekenen das aceive full credit .tostring() - rensa sering describing the kenon follow Note: replace the values in brackets with the challel My name is the and 1 teeny level is level and current stanna is (stanna). 1 a a Iceman, and I have do not have a pet. You must use the ring method from the Teamon class to receive credit Getters and Setters as nece Firenon.java This thesis Fremoniemen tekemon and the tree tribute There is a clywed found in 1:33). Al variables must be not allowed the directly offed dette in which they wedere hrasested in the description of the anableHit there is a specific modifier that can The Firenons must have the bles. Do NOT refecare an instance we created in the elemen kolegelevel the knowledge of the non represented by anger firePoints - the totalment of points the Firemen hemed represented by an integer Construction A coarctar that takes is the name Devel, standina knowledgelevel and tirepoints and as felds accordingly must rept the ribes the specified order A constructor that it med mig the following default level: 10 stania: 20 werlevel: FirePoints Methods Do not create any other methods than the species. Any extra methods will result in point deduction AB methods must have the propervisbility to be used where it is specified duel (Tekmont) Should were the method declared in the Tremontant Feither the Premon's or the Tokemon's starina , they cannot doel We target Tekemon is another Firmen, they who can do.Cannot del ally" Other, the remontow begins their attack a remondigevel pick a random integer between 1 and 10 incive. If the number soddeall Greene . the remon's knowledgeLevel 13 or below.de nothing Calendar To Do Notifications Inbos Decrease the targeted Telemos sermon's developed If the son of the Teema below set the stomato . The deleted the rest her deleting the spent the formen canfire aints equal to half of the opponent's level round to be seest Call levels conents deleted in case the Firemon can move up Destroying Firefight) The Firenon's anias. yan ay Add 20 points to firepoints the remon's wedgelevelit greater than or ults 30 Add y Fire Pits well than 30 After print Clevel() shoes This method should not return Teve) should override sep) mestod declared in the Telemon superclass e Fenon's level is more 30, then the mount of fireaints required to move by levels trets Otherww.il heimon levels were the mount of FirePointed to move up by 0 Frete Once moving the rep by the front wariable should be reset to Andional points remaining to try beyond the minimum should be added back to the firePoints Ar printay. I level level Roseat the bovenverting the statement mulle tinere Tiemontes . This method should not saying quals(Object ) - method usemide elemen's equals() method Two From they have the same level stamina, and knowledgelevel You must use the methode Teemos crecere credit tostring() return as demonstow Note replace the values in brackets were My name is Enamel and Teken. Level 1 [level] and my current stain is [stania Firen and I have (knowledgeleve noge. You hear the theme receive full credit. Getters and Setters as necessary wreckFight.java This love is a driver meaning it will come and French and drive there cording to a set of This is to show in esamele aflat implementation to watjes interact with each other fore to play around with different and method calling this wat be turned Calendar To Do Notifications Inbox . Afterwards printay, I an now level level]" Repeat the above steps until the Firemion is no longer able to level. multiple times the Firemonfavels up multiple times This method should not return anything equals(Object o) this method ist override Teamon's equals!) method Two Fremontare qualif they have the same name level, tanina, dowledgeLevel You must use the equatic method from the Tekemon's laws to receive all credit .toString() returns String describing the Firemonas follows (Note: replace the values in brackets with the actual "My name is name, and I am a Ten. My level is [level] and my current stanna is (starina). Ia a Firenon, and knowledge level] knowledge. You must use the toStrinal method from the Tekemon class receive full credit Getters and Setters secary WreckFight.java This lava file as a driver, meaning it will contain and run icemen and Fremon open weet values according to a simulated set of action This is just to show an example of object implementation to see how objects interact with each other. Feel free to play around with different values and method callings This Sie will NOT be din Create we lemons . A lemon with the following values nane: Edward Cullen . level 101 stamina 50 . petal IcePoints A lemon with just the passed in name: "Dedric Clapory Create a Firemon A Fremon with the following values .name Stan Loone level: 16 standina 12 knowledgeLevel: as firepoints: 0 Armon with the pain name: "Che Cheng Perform the following method calls Print the dward Cullen" object with toring Print the "Dedric Cigory object with toring Print the 'Cho Chang object with otring Print the "Stan toona' object with totring Have Edward Cullen duel Cho Cheng Edward Culien drinks potion Dedric Dierony duels Stan Loon Print the dward Cullect with to Print the "Dedi Cory object with tearing Print the "Cho Cheng' object with toStrinell Print the "San Loon object with toString House your code when positie. Certain methods can be used in certain you the goverride tag for a method, you will not have to write the lavadocs for the method. These and the ones on Gradescope are by no means comprehensive so be sure to create your own

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

Write the properties of Group theory.

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago