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, 23.06.2019 06:30
To become an audio technician, the most successful tactics might include the following. (select all that apply). learning how to persuade other people gaining different types of experience in audio technology learning as much as possible about art history establishing a reputation as a reliable professional
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
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
Social Studies, 15.10.2019 19:50
question
Chemistry, 15.10.2019 19:50
question
Mathematics, 15.10.2019 19:50
question
History, 15.10.2019 19:50
question
Mathematics, 15.10.2019 19:50
question
Business, 15.10.2019 19:50
question
Mathematics, 15.10.2019 19:50
Questions on the website: 13722367