- 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 +

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education