Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions

Question

Intelligence quotient (IQ) has an emotional component. True False

Answered: 1 week ago