Answered step by step
Verified Expert Solution
Link Copied!

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

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

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions

Question

a . What are non - living things?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago