Question: Java Create a class called Character that a role-playing game might use to represent a character within the game. A character should include six stats

Java

Create a class called Character that a role-playing game might use to represent a character within the game. A character should include six stats as instance variables - strength, dexterity, constitution, intelligence, wisdom and charisma of the character (all types are int). Your class should have a constructor that initializes these six instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getStatsTotal that calculates the total of these six stats, then returns the amount as an int value. If the total is not positive, it should be set to 0. Write a test application named CharacterTest that demonstrates class Characters capabilities.

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!