Question: in C++ please Exercise L1-1 Chapter 10 Classes & Data Abstraction Write a program that uses the die class (die. h file is shown below

in C++ please
in C++ please Exercise L1-1 Chapter 10 Classes \& Data Abstraction Write
a program that uses the die class (die. h file is shown
below ), you must implement this six-sided die class in the die.
cpp file. Your program will prompt the user to enter the number

Exercise L1-1 Chapter 10 Classes \& Data Abstraction Write a program that uses the die class (die. h file is shown below ), you must implement this six-sided die class in the die. cpp file. Your program will prompt the user to enter the number of dies in a set (4 through 6 ) that will be rolled together. The sum of the faces on the set will be the index to an array that holds the number of times this sum has occurred. You must also prompt your user for the number of times the set will be rolled. ( 2500,3000,0 or 5000 times). Once the rolls are completed the program will display a bar graph, like the one below, showing the sum value, the number of times it was rolled, and a bar of asterisks each one representing 2% of the highest count recorded in this run. In the example below, the highest value is 464 , therefor, each asterisk is 2% of 464 which, rounded down, is 9 . So, for the highest value of 464 there are 49 asterisks. Except for the values for the rolls counts, because these should be random based on the dies used in the rolls, your output should look identical to the mockup below. Executable versions of this exercise are in the projects folders under_Solutions, so you can see the results of various trials. \#pragma once class die \{ public: die(); //Default constructor //sets the default number rolled by a die to 1 void roll(); //Function to roll a die. //This function uses a random number generator to randomly //generate a number between 1 and 6 , and stores the number l/in the instance variable num. int getNum() const; //Function to return the number on the top face of the die. //Returns the value of the instance variable num. private: 3 ; int num; //The value of this instance (1 through 6 variable num. void die::roll() \{ 3 int die::getNugn() const \{ J See Example output on next page Enter the number of Dies to use (4,5. or 6) You may use the example code below as a starting point for this graph. sout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!