Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 objectoriented 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 kinds of characters: attacking, defending, and healing.
Every character will have a name, base health value, shield value, and power level
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 Sample output for printCharacterPrintStream
Your code should have a single abstract class called Character. You should have classes that extend from the Character class. The Character class should have abstract methods: useAbility Character and printCharacterPrintStream
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 objectoriented 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 kinds of characters: attacking, defending, and healing.
Every character will have a name, base health value, shield value, and power level
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 Sample output for printCharacterPrintStream
Your code should have a single abstract class called Character. You should have classes that extend from the Character class. The Character class should have abstract methods: useAbility Character and printCharacterPrintStream
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started