Question
Dice Roll Simulator Write a class named Dice. The Dice class should have the following member variable: A integer named sideUpValue. The sideUpValue member variable
Dice Roll Simulator Write a class named Dice. The Dice class should have the following member variable: A integer named sideUpValue. The sideUpValue member variable will hold the value (1,2,3,4,5,6) facing up when the dice is rolled. The Dice class should have the following member functions: A void member function named Roll that simulates the Rolling of the dice. When the Roll member function is called, it randomly generates the value of the dice that faces up (1,2,3,4,5,6) A member function named getSideUp that returns the value of the sideUp member variable. Write a program that demonstrates the Dice class. The program should create an instance of the class and display the side that is initially facing up. Then, use a loop to throw the dice 100 times. After which display a Column chart showing how much each number showed up. Something like this: 1 ***************** 2********************************** 3***************** 4*************************************************** 5***************** 6**********************************
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started