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 17:30
The forerunner to cell phones, pdas, and smartphones was
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
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
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, 02.03.2021 02:30
question
Biology, 02.03.2021 02:30
question
Spanish, 02.03.2021 02:30
question
Health, 02.03.2021 02:30
Questions on the website: 13722367