Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

11. Are your speaking notes helpful and effective?

Answered: 1 week ago

Question

The Goals of Informative Speaking Topics for Informative

Answered: 1 week ago