- Name the demo file firstname_lastname_PE2 Create a program that simulates a dumpster diving game. Dumpster diving is when you search for loot in arge industrial sized trash bins. In the game you will roll a ten-sided dice to determine what the user has received. Use the UML below as a guide for the Die class (Name the class Die.java). Die - sideUp: int = 10 - value: int + Die() + roll(): void + getvalue(): int +

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 3GZ
icon
Related questions
Question
100%
2. Name the demo file firstname_lastname_PE2
Create a program that simulates a dumpster diving game. Dumpster diving is when you search for loot in
large industrial sized trash bins. In the game you will roll a ten-sided dice to determine what the user
has received. Use the UML below as a guide for the Die class (Name the class Die.java).
Die
- sideUp: int = 10
- value: int
+ Die()
+ roll(): void
+ getvalue(): int
Below are some suggestions to aid you in designing the game:
• Each round of the game is performed as an iteration of a loop that repeats as long as the player
wants to "dive" for more items.
• At the beginning of each round, the program will ask the user whether or not he or she wants to
continue diving.
The program simulates the rolling of a ten-sided die
Each item that can be caught is represented by a number generated from the die; for example, 1
for "a half-eaten sandwich", 2 for "a left shoe", 3 for "a broken watch", and so on.
• Each item the user catches is worth a different amount of points.
• The loop keeps a running total of the user's loot points.
• After the loop has finished, the total number of loot points is displayed, along with a message
that varies depending on the number of points earned.
Program must ask user if they want to dive again (-30% if it doesn't)
Transcribed Image Text:2. Name the demo file firstname_lastname_PE2 Create a program that simulates a dumpster diving game. Dumpster diving is when you search for loot in large industrial sized trash bins. In the game you will roll a ten-sided dice to determine what the user has received. Use the UML below as a guide for the Die class (Name the class Die.java). Die - sideUp: int = 10 - value: int + Die() + roll(): void + getvalue(): int Below are some suggestions to aid you in designing the game: • Each round of the game is performed as an iteration of a loop that repeats as long as the player wants to "dive" for more items. • At the beginning of each round, the program will ask the user whether or not he or she wants to continue diving. The program simulates the rolling of a ten-sided die Each item that can be caught is represented by a number generated from the die; for example, 1 for "a half-eaten sandwich", 2 for "a left shoe", 3 for "a broken watch", and so on. • Each item the user catches is worth a different amount of points. • The loop keeps a running total of the user's loot points. • After the loop has finished, the total number of loot points is displayed, along with a message that varies depending on the number of points earned. Program must ask user if they want to dive again (-30% if it doesn't)
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT