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

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 0 Create a method called eatPeasant that increases peasantsEaten by one. Create a method called getPeasantsEaten that returns peasantsEaten. Override isFriendly to return false. The second is called MetallicDragon. The class must meet the following specifications
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
