Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Su/21/content/2790626/Iwontent/2017/44/View Pokemon also known as Pocket Monsters in Japan, is a media franchise managed by The Pokemon Company, a Japanese consortium between Nintendo Game Freak,

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Su/21/content/2790626/Iwontent/2017/44/View Pokemon also known as Pocket Monsters in Japan, is a media franchise managed by The Pokemon Company, a Japanese consortium between Nintendo Game Freak, and Creatures. Pokmy Q1: Inheritance, Abstract Class and Interface(4 points) Please use the follow UML diagram (shown in 1) to implement an abstract Pokemon class, Bulbaur class and Charmander class. And three interfaces, Grass Poison and Fire Figure 1: UML diagram for multiple classes For each Pokemon object, it has two fields: 113 edu/a2/e/content/2790616/viewContent/21017744/View HP: the health point of the Pokemon object, the initial value is 1 level: the level of the Pokemon object, the initial value is 1 For Bulbsaur and Charmander class, it has one extra field: name: the initial value for Bulbsaur is "Bulbsaur" and for Charmander is "Char- mander". For each interface, it has one field: type: the value for Grass is "Grass", for Fire is "Fire", and for Poison is "Poison". Methods in the UML: get HPO Sint: This method return an int value to show the current health-point of this Pokemon BetHP(hp int) : void: This method accepts an int value and use it to set current health-point of this Pokemon. get Level() int: This method return an int value to show the current level of this Pokemon levelUp void: This method increase the current level of this Pokemon by 1. wine Whip) String: This method return a String "Pokemon xxx launched Wine Whip Attack!!" where xxx should be replaced by the name of the Pokemon. posion Powder(): String: This method return a String "Pokemon xxx launched Poison Powder Attack!!" where yoxx should be replaced by the name of the Pokemon ember() String: This method return a String "Pokemon xxx launched Ember Attack!!" where XXX should be replaced by the name of the Pokemon Q2: Fixing Error (1 point) Download the Pokemon class files that created by Dr. Chen, unzip and put them into your working folder (the folder contains Pokemon.java). You realized that you forget to create the field and it's mutator and accessors methods. Please change the Pokemon class to make sure you can compile and run the Home Lanama or + 2 /3 O P N me/content/27e0626/view.content/21201682/ 2. Bio Weapon.(10 Points). Q1: Inheritance, Abstract Class and Interface (6 points) Please use the follow UML diagram (shown in 1) to implement an abstract Bio Weapon class, Licker class and Zombie Dog class. And two interfaces, Movable and Canine, Blon Licker - HP -type: Buring . : Baring HPTION:void + gel Type: Shing movergnevold mbog mow Upovola +movela void +moveight:void move por +movala movna vod Figure 1: UML diagram for multiple classes For each BioWeapon object, it has one field: HP: the health point of the BioWeapon object, the initial value is 1 For Licker and ZombieDog class, it has one extra field: type: the initial value for Licker is " Human" and for Zombie Dog is " Canine" Methods in the UML: get HP() int: This method return an int value to show the current health-point. set HP(hp:int) : void: This method accepts an int value and use it to set current health-point. getType(): String: This method return a String value to show the lype. moveUp(): void: This method output "XXX move up" where XXX is replaced by either "Zombie Dog" or "Licker". moveDown(): void: This method output "XXX move down" where XXX is replaced by either "Zombie Dog" or "Licker". moveRight() : void: This method output "XXX move to the right" where XXX is! replaced by cither "Zombic Dog" or "Licker". + 2 13 Pokemon - HP: int -level : int + getHP: int + setHPhp:int) : void + getLevel : int + levelUP(): void + getName(): String > Grass + type : String +vine Whip: String Bulbsaur Charmander > Fire - name : String - name : String ----- > Poison - type : String + posion Power : String + type : String + ember): String + getName(): String + vineWhip) : String + posionPower : String + getName(): String + ember): String Figure 1: UML diagram for multiple classes . AT&T All pre-existing code: public class Ivysaur extends Pokemon private String name = "Ivysaur"; public Ivysaur() setID(2); public String getName() return name; public class Charmeleon extends Pokemon private String name = "Charmeleon": public Charmeleon() setID(5); public String getName() return name; public class Charizard extends Pokemon private String name = "Charizard"; public Charizard) setID(6); public String getName() return name; public class Homework 2Demo { public static void main(String[] args) { Charizard p1 = new Charizard(); Charmeleon p2 = new Charmeleon(); Ivysaur P3 = new Ivysaur(); Su/21/content/2790626/Iwontent/2017/44/View Pokemon also known as Pocket Monsters in Japan, is a media franchise managed by The Pokemon Company, a Japanese consortium between Nintendo Game Freak, and Creatures. Pokmy Q1: Inheritance, Abstract Class and Interface(4 points) Please use the follow UML diagram (shown in 1) to implement an abstract Pokemon class, Bulbaur class and Charmander class. And three interfaces, Grass Poison and Fire Figure 1: UML diagram for multiple classes For each Pokemon object, it has two fields: 113 edu/a2/e/content/2790616/viewContent/21017744/View HP: the health point of the Pokemon object, the initial value is 1 level: the level of the Pokemon object, the initial value is 1 For Bulbsaur and Charmander class, it has one extra field: name: the initial value for Bulbsaur is "Bulbsaur" and for Charmander is "Char- mander". For each interface, it has one field: type: the value for Grass is "Grass", for Fire is "Fire", and for Poison is "Poison". Methods in the UML: get HPO Sint: This method return an int value to show the current health-point of this Pokemon BetHP(hp int) : void: This method accepts an int value and use it to set current health-point of this Pokemon. get Level() int: This method return an int value to show the current level of this Pokemon levelUp void: This method increase the current level of this Pokemon by 1. wine Whip) String: This method return a String "Pokemon xxx launched Wine Whip Attack!!" where xxx should be replaced by the name of the Pokemon. posion Powder(): String: This method return a String "Pokemon xxx launched Poison Powder Attack!!" where yoxx should be replaced by the name of the Pokemon ember() String: This method return a String "Pokemon xxx launched Ember Attack!!" where XXX should be replaced by the name of the Pokemon Q2: Fixing Error (1 point) Download the Pokemon class files that created by Dr. Chen, unzip and put them into your working folder (the folder contains Pokemon.java). You realized that you forget to create the field and it's mutator and accessors methods. Please change the Pokemon class to make sure you can compile and run the Home Lanama or + 2 /3 O P N me/content/27e0626/view.content/21201682/ 2. Bio Weapon.(10 Points). Q1: Inheritance, Abstract Class and Interface (6 points) Please use the follow UML diagram (shown in 1) to implement an abstract Bio Weapon class, Licker class and Zombie Dog class. And two interfaces, Movable and Canine, Blon Licker - HP -type: Buring . : Baring HPTION:void + gel Type: Shing movergnevold mbog mow Upovola +movela void +moveight:void move por +movala movna vod Figure 1: UML diagram for multiple classes For each BioWeapon object, it has one field: HP: the health point of the BioWeapon object, the initial value is 1 For Licker and ZombieDog class, it has one extra field: type: the initial value for Licker is " Human" and for Zombie Dog is " Canine" Methods in the UML: get HP() int: This method return an int value to show the current health-point. set HP(hp:int) : void: This method accepts an int value and use it to set current health-point. getType(): String: This method return a String value to show the lype. moveUp(): void: This method output "XXX move up" where XXX is replaced by either "Zombie Dog" or "Licker". moveDown(): void: This method output "XXX move down" where XXX is replaced by either "Zombie Dog" or "Licker". moveRight() : void: This method output "XXX move to the right" where XXX is! replaced by cither "Zombic Dog" or "Licker". + 2 13 Pokemon - HP: int -level : int + getHP: int + setHPhp:int) : void + getLevel : int + levelUP(): void + getName(): String > Grass + type : String +vine Whip: String Bulbsaur Charmander > Fire - name : String - name : String ----- > Poison - type : String + posion Power : String + type : String + ember): String + getName(): String + vineWhip) : String + posionPower : String + getName(): String + ember): String Figure 1: UML diagram for multiple classes . AT&T All pre-existing code: public class Ivysaur extends Pokemon private String name = "Ivysaur"; public Ivysaur() setID(2); public String getName() return name; public class Charmeleon extends Pokemon private String name = "Charmeleon": public Charmeleon() setID(5); public String getName() return name; public class Charizard extends Pokemon private String name = "Charizard"; public Charizard) setID(6); public String getName() return name; public class Homework 2Demo { public static void main(String[] args) { Charizard p1 = new Charizard(); Charmeleon p2 = new Charmeleon(); Ivysaur P3 = new Ivysaur()

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Accounting questions

Question

Strong analytical, communication, and problem-solving skills

Answered: 1 week ago