Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In 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

In 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

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

More Books

Students also viewed these Databases questions