Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java create an overloaded constructor for Monster which sets the properties as follows: inType will be a String we'll pass to the constructor to

in java 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.
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.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Data Science Project Ideas In Health Care Volume 1

Authors: Zemelak Goraga

1st Edition

B0CPX2RWPF, 979-8223791072

More Books

Students also viewed these Databases questions

Question

Pinpoint your needs for improvement in interpersonal relations.

Answered: 1 week ago