Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java 2) Create a character class hierarchy. You should have at least 1 abstract class and at least 3 types of characters (4 classes total).

java image text in transcribed
2) Create a character class hierarchy. You should have at least 1 abstract class and at least 3 types of characters (4 classes total). Each character should implement the following: public int attack() returns the strength of an attack . public void hit(int points) reduces the character's health based on the strength of an attack public boolean is Alive() returns a Boolean based on whether or not the character's health is greater than 0. The name, strength, and health of each character. 3) Write a toString() method for your character classes that displays the name, class, strength, & health of the character 4) Create a driver class that simulates a battle between two characters. Your logic for battle does not need to be complex 2) Create a character class hierarchy. You should have at least 1 abstract class and at least 3 types of characters (4 classes total). Each character should implement the following: public int attack() returns the strength of an attack . public void hit(int points) reduces the character's health based on the strength of an attack public boolean is Alive() returns a Boolean based on whether or not the character's health is greater than 0. The name, strength, and health of each character. 3) Write a toString() method for your character classes that displays the name, class, strength, & health of the character 4) Create a driver class that simulates a battle between two characters. Your logic for battle does not need to be complex

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions