Question: Objectives: Inheritance is an essential aspect of object - oriented programming languages like java. It allows one class to inherit the features of a parent

Objectives: Inheritance is an essential aspect of object-oriented programming languages like java. It allows one class to inherit the features of a parent class. This allows for reusability, overriding, and abstraction. Abstraction is the process of only showing the essential detail to the user. This can be achieved by using abstract classes. An abstract class is declared with the keyword abstract. An abstract class cannot be created as an instance in the code. By completing the assignment, students will demonstrate knowledge of the following:
Creating abstract classes
Creating inheriting classes
Task Description: A game company has come to you to ask for you to create characters in their game. There are 3 kinds of characters: attacking, defending, and healing.
Every character will have a name, base health value, shield value, and power level (0100).
Each subtype of character has another attribute specific to them. Healers have a healing value, dealers have an attack value, and defenders have defense values.
Each subtype of character can use an ability and what the ability does is different for each subtype. Healers will heal a target Character for their healing value up to the target's base health value, dealers will deal damage to a Character's HP for their attack value, and defenders will raise a Character's shield by their defense value.Figure 1 Sample output for printCharacter(PrintStream)
Your code should have a single abstract class called Character. You should have 3 classes that extend from the Character class. The Character class should have 2 abstract methods: useAbility (Character) and printCharacter(PrintStream).
Your main method only needs to demonstrate that your classes work as expected. Create at least one of each subtype of Character and a "dummy" Character you can use
for testing by applying each ability to it. Print the results to the console so that they can be verified by eye. Also, show that each printCharacter method outputs as expected.Objectives: Inheritance is an essential aspect of object-oriented programming languages like java. It allows one class to inherit the features of a parent class. This allows for reusability, overriding, and abstraction. Abstraction is the process of only showing the essential detail to the user. This can be achieved by using abstract classes. An abstract class is declared with the keyword abstract. An abstract class cannot be created as an instance in the code. By completing the assignment, students will demonstrate knowledge of the following:
Creating abstract classes
Creating inheriting classes
Task Description: A game company has come to you to ask for you to create characters in their game. There are 3 kinds of characters: attacking, defending, and healing.
Every character will have a name, base health value, shield value, and power level (0100).
Each subtype of character has another attribute specific to them. Healers have a healing value, dealers have an attack value, and defenders have defense values.
Each subtype of character can use an ability and what the ability does is different for each subtype. Healers will heal a target Character for their healing value up to the target's base health value, dealers will deal damage to a Character's HP for their attack value, and defenders will raise a Character's shield by their defense value.Figure 1 Sample output for printCharacter(PrintStream)
Your code should have a single abstract class called Character. You should have 3 classes that extend from the Character class. The Character class should have 2 abstract methods: useAbility (Character) and printCharacter(PrintStream).
Your main method only needs to demonstrate that your classes work as expected. Create at least one of each subtype of Character and a "dummy" Character you can use
for testing by applying each ability to it. Print the results to the console so that they can be verified by eye. Also, show that each printCharacter method outputs as expected.
 Objectives: Inheritance is an essential aspect of object-oriented programming languages like

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!