Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hey I need this in java I have all the enemy classes you have to create a main class I will put an example of

hey I need this in java I have all the enemy classes you have to create a main class I will put an example of a main class how want and

i will also give all the enemy classes for and you also have to make last enemy class

The Main class should create the following objects greenOgre, redOgre, slowZombie, fastZombie, spotDog, and yourNameYourObject.

Enemy Class

Enemy: Ogre Class

Enemy: Zombie Class

Enemy: Dog Class

Enemy: GiantSpider Class

Enemy: (Your) Class

example of my main class:-

image text in transcribedimage text in transcribed

enemy class ss:-

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

no usages public class Main \{ no usages public static void main(String[] args) \{ I/ System. out. println("Hello world!"); Item item = new Item( name: "Item name", description: "Item description", value: 10); System. out.println(item.tostring()); Weapon weapon = new Weapon( name: "Weapon name", description: "Weapon description", value: 20, damage: 8); System. out.println(weapon. str ()); Gold gold = new Gold( amt: 24); System. out.println(gold.tostring()); Sword sword = new Sword(); System. out. println(sword.tostring()); System. out.println(sword.str()); Pillow pillow = new Pillow (; System. out.println(pillow.tostring()); System. out.println(pillow. str()); Mace mace = new Mace(); System. out. println(mace.str()); Arrow arrow = new Arrow(); System. out.println(arrow.str()); Gold goldBar = new Gold( name: "Gold Bar", description: "1KG Gold Bar", amt: 200); System. out.println(goldBar.tostring()); //Class Ogre inherits from Enemy parent class public class Ogre extends Enemy //Constructor method for the ogre class //There are no input arguments public Ogre()\{ //Calls the Super class passing in the enemy's name, health points, damage points super( name: "Ogre", hp: 30, damage: 20); \} //Closes the Ogre class code block //class Zombie inherits from Enemy parent class public class Zombie extends Enemy\{ //Constructor method for the Zombie class //There are no input arguments public Zombie()\{ // Calls the Super class passing in the enemy's name, health points, damage points super( name: "Zombie", hp: 20, damage: 15); \} //Class Dog inherits from Enemy parent class public class Dog extends Enemy\{ //Constructor method for the Dog class //There are no input arguments public Dog()\{ // Calls the Super class passing in the enemy's name, health points, damage points super( name: "Dog", hp: 20, 15; \} \}//Closes the Dog class code block //class Giantspider inherits from Enemy class public class Giantspider extends Enemy\{ //Constructor method for the class public GiantSpider()\{ //Calls the Super class passing in the enemy's name, health points, damage points super( name: "Giant Spider", hp: 10, damage: 2); //Calls the super class constructor \}

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

Students also viewed these Databases questions

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago