Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA Here is the monster class import java.util.Scanner; public abstract class Monster implements Drawable, Loadable { private int x; private int y; private int

image text in transcribed

IN JAVA

Here is the monster class

import java.util.Scanner; public abstract class Monster implements Drawable, Loadable { private int x; private int y; private int health; protected Monster() { x = 0; y = 0; health = 100; } protected Monster(int x, int y, int health) { this.x = x; this.y = y; this.health = health; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public int getHealth() { return health; } public void setHealth(int health) { this.health = health; } @Override public void load(Scanner input) throws Exception { x = input.nextInt(); y = input.nextInt(); health = input.nextInt(); } }
4 Create an Orc class that extends Monster. It should have the following PUBLIC methods: No-arg constructor (does nothing) Constructor that takes x, y, and health (calls super constructor from Monster Concrete implementation of Drawable method: voiod drawToMap(Map screen) If screen is nu, return. Otherwise, draw 'o' at (x,y) of 5 Create an Spider class that extends Monster It should have the following PUBLIC methods: No-arg constructor (does nothing) Page 3 of 9 Constructor that takes x, y, and health (calls super constructor from Monster) Concrete implementation of Drawable method: void drawToMap(Map screen) If screen is screen return. Otherwise, draw 's' at (x,y) of 4 Create an Orc class that extends Monster. It should have the following PUBLIC methods: No-arg constructor (does nothing) Constructor that takes x, y, and health (calls super constructor from Monster Concrete implementation of Drawable method: voiod drawToMap(Map screen) If screen is nu, return. Otherwise, draw 'o' at (x,y) of 5 Create an Spider class that extends Monster It should have the following PUBLIC methods: No-arg constructor (does nothing) Page 3 of 9 Constructor that takes x, y, and health (calls super constructor from Monster) Concrete implementation of Drawable method: void drawToMap(Map screen) If screen is screen return. Otherwise, draw 's' at (x,y) of

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

Students also viewed these Databases questions

Question

What is the difference between skewness and kurtosis? Discuss.

Answered: 1 week ago

Question

4. What decision would you make and why?

Answered: 1 week ago

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago