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
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