Question: use ja Use java as the programming language You are to define an abstract class called Dragon, because everything is better with dragons. The class

use jause jaUse java as the programming language You are to define anabstract class called Dragon, because everything is better with dragons. The classUse java as the programming language

You are to define an abstract class called Dragon, because everything is better with dragons. The class must meet the following specifications .The class should have an integer field to store the amount of damage the dragon's breath attack does (called breathDamage) and a String to hold the dragon's name (called name). You must choose the appropriate access level for your fields .You must provide two constructors for the class. The first is a parameterized constructor that takes in the breathDamage and name and initializes them. The second is a no parameter constructor that calls the parameterized constructor with name as "Generic Dragon" and breathDamage of 10. You will use the this keyword to call the other constructor Create a method called getName that returns the dragon's name Create a method called getBreathDamage that returns the dragon's breath damage Create an abstract method called isFriendly that takes no parameters and returns a boolean You will now create two derived classes from the Dragon class. The first is called ChromaticDragon. The class must meet the following specifications .The class should have an integer field to store the number of peasants eaten (called peasantsEaten). You must choose the appropriate access level for your fields .You must provide a single constructor for the class. This is a parameterized constructor that takes in the breathDamage and name and passes them to the super constructor. It then sets peasantsEaten to o Create a method called eatPeasant that increases peasantsEaten by one Create a method called getPeasantsEaten that returns peasantsEaten. Override isFriendly to return false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!