Question: In Java, we will create a monster game. Create a default constructor for Monster that sets property values as follows: Name will be none, and

In Java, we will create a monster game. 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 1. 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 1
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 6 of the properties for Monsters: name, size, strength, and hitPoints.
Create getters for all 6 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 3-10(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

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!