first need to define the properties and behaviors of a single die that can be reused multiple times in your future code. This will be done by creating a Dice class. Create a Dice class that contains the following members: Two private integer variables to store the minimum and maximum roll possible. Two constructors that initialize the data member

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
Dice Rolling Class In this problem, you will need to create a program that simulates rolling dice. To start this project, you will first need to define the properties and behaviors of a single die that can be reused multiple times in your future code. This will be done by creating a Dice class. Create a Dice class that contains the following members: Two private integer variables to store the minimum and maximum roll possible. Two constructors that initialize the data members that store the min/max possible values of rolls. a constructor with default min/max values. a constructor that takes 2 input arguments corresponding to the min and max roll values Create a roll() function that returns a random number that is uniformly distributed between the minimum and maximum possible roll values. Create a small test program that asks the user to give a minValue and maxValue for a die, construct a single object of the Dice class with the constructor that initializes the min and max values for the die as minValue and maxValue, respectively, and then roll the die 10 times. Each time the die is rolled, print the value of the roll to the terminal using cout. Remember to set up your random number generation correctly for your test program. Example Output Example 1 (user input is underlined): Let's set up a die to roll. What are the minimum and maximum values for this die? Minimum Value: 1 Maximum Value: 6 The die is rolled 10 times. The results of those rolls are: Roll #1 was: 1 Roll #2 was: 2 Roll #3 was: 4 Roll #4 was: 4 Roll #5 was: 1 Roll #6 was: 4 Roll #7 was: 4 Roll #8 was: 2 Roll #9 was: 6 Roll #10 was: 2 Example 2 (user input is underlined): Let's set up a die to roll. What are the minimum and maximum values for this die? Minimum Value: 3 Maximum Value: 11 The die is rolled 10 times. The results of those rolls are: Roll #1 was: 3 Roll #2 was: 9 Roll #3 was: 11 Roll #4 was: 3 Roll #5 was: 6 Roll #6 was: 3 Roll #7 was: 4 Roll #8 was: 6 Roll #9 was: 6 Roll #10 was: 7 Name the source code file username_hw6A.cpp. Pls send me solution fast within 20 min and i will rate instantly for sure!! Solution must be in typed form!!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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