subject

In Java:
Buh-RING IT! For this assignment, you’re going to simulate a text-based Role-Playing Game (RPG). Design (pseudocode) and implement (source) for a program that reads in 1) the hero’s Hit Points (HP – or health), 2) the maximum damage the hero does per attack, 3) the monster’s HP and 4) the maximum monster’s damage per attack. When the player attacks, it will pick a random number between 0 and the maximum damage the player does, and then subtract that from the monster. A similar thing happens when the monster attacks the hero. The program should display rounds and the HP of the hero and monster each round. If the hero or monster dies, it should print that this happened and should NOT continue (i. e. no extra text). To learn how to create random numbers, see the appendix.

Sample run 1:
Enter the hero's initial hit points: 50
Enter the damage the hero’s weapon does per strike: 20
Enter the monster's initial hit points: 40
Enter the monster's damage per strike: 15
ROUND 1
Hero attacks for: 10
Monster has 30 HP left
Monster attacks you for: 1
You have 49 HP left
ROUND 2
Hero attacks for: 18
Monster has 12 HP left
Monster attacks you for: 7
You have 42 HP left
ROUND 3
Hero attacks for: 0
Monster has 12 HP left
Monster attacks you for: 14
You have 28 HP left
ROUND 4
Hero attacks for: 18
Monster has -6 HP left
The monster dies and you earn 5 XP
Battle ends...

Sample run 2:
Enter the hero's initial hit points: 50
Enter the damage the hero’s weapon does per strike: 10
Enter the monster's initial hit points: 40
Enter the monster's damage per strike: 20
ROUND 1
Hero attacks for: 1
Monster has 39 HP left
Monster attacks you for: 6
You have 44 HP left
ROUND 2
Hero attacks for: 5
Monster has 34 HP left
Monster attacks you for: 1
You have 43 HP left
ROUND 3
Hero attacks for: 8
Monster has 26 HP left
Monster attacks you for: 8
You have 35 HP left
ROUND 4
Hero attacks for: 4
Monster has 22 HP left
Monster attacks you for: 5
You have 30 HP left
ROUND 5
Hero attacks for: 7
Monster has 15 HP left
Monster attacks you for: 1
You have 29 HP left
ROUND 6
Hero attacks for: 7
Monster has 8 HP left
Monster attacks you for: 9
You have 20 HP left
ROUND 7
Hero attacks for: 0
Monster has 8 HP left
Monster attacks you for: 14
You have 6 HP left
ROUND 8

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
Answers: 1
You know the right answer?
In Java:
Buh-RING IT! For this assignment, you’re going to simulate a text-based Role-Playing...
Questions
question
Mathematics, 09.12.2020 07:30
question
Mathematics, 09.12.2020 07:40
question
English, 09.12.2020 07:40
Questions on the website: 13722367