Java AP LESSON WORK QUESTION
1 Write the program that will reproduce
the following output. Note that the min function only works on two values at once. Also, the four marks below are entered by
the user.
QUESTION
2
·
name ·
lowDamage ·
highDamage The lowDamage and highDamage give the range of the damage that the weapon
can make. So if lowDamage
is 7 and highDamage is 12, then the Weapon will do
7-12 damage. ACTIONS After creating the class above, write the code that
represents the following actions. 1-Create a weapon called "Staff". Its damage is 6-10. 2-Your character is in a battle and you need to
calculate how much damage the Staff does.
In other words, you need to generate a random number between 6 and
10. Test your program several times to
makes sure the number fits. 3-Create another weapon called "Thor's
Hammer". Its damage is 210-250. 4-Thor is in a battle and swings his hammer 5 times
at five different enemies. Write the statements required to generate the five
different damage amounts. |