Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in javJava for a game called monster, Create a default constructor for Monster that sets property values as follows: Name will be none, and all
in javJava for a game called monster, Create a default constructor for Monster that sets property values as follows:
Name will be "none", and all of the other integer properties set to Do not set a type
Create an overloaded constructor for Monster which sets the properties as follows:
inType will be a String we'll pass to the constructor to set the Monster's type
inName will be a String we'll pass to the constructor to set the Monster's name.
inLevel will be an integer we'll pass to the constructor to set the Monster's level
size set to
strength to the return value of a method that we'll create called calcSTR
hitPoints to the return value of a method that we'll create called calcHP
Create setters for all of the properties for Monsters: name, size, strength, and hitPoints.
Create getters for all of the properties for Monsters: type, name, level, size, strength, and hitPoints.
Write a calcSTR method used to calculate the strength of the Monster as follows:
calcSTR requires no passed parameters and uses standarddata fields
calcSTR should return an integer:
First, it generates a random integer from inclusive using the Random Class.
Then, it adds the level times the size to the random integer you had generated.
Finally, it returns the result of that complete calculation
Write a calcHP method used to calculate the hitPoints of the Monster as follows:
calcHP requires no passed parameters and uses our standard Monster properties
calcHP should return an integen
The integer value returned should be the strength times the level divided by two.
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