Question: Urgent help needed in c++ program ! Thanx :) In C++, you can generate random numbers by calling a function named rand () which is

Urgent help needed in c++ program ! Thanx :)

Urgent help needed in c++ program ! Thanx :) In C++, you

In C++, you can generate random numbers by calling a function named rand () which is defined in header file. To generate random numbers between 1 and an integer N use the expression: (rand ( ) % n + 1) . Write a program that simulates the tossing of 100 dices and prints a histogram of the results. The following is sample outcome: One: Two: Three: Four: Five * * Six: Represent your histogram as an array of bars each of which has the following structure: enum Sidef ONE, TWO, THREE, FOUR, FIVE, SIX struct Bar int value; Side label; Your program should create and use at least the following three functions string getSideLabel (Side s) / returns the string label for each void generateData (Bar hist[], int tossesCount= 100); // Randomly // of the enumerated sides // generate the dice tosses. By default 100 tosses will be // generated. The results are saved into the array histI) string getAistogram (Bar hist[], char c = '*'); // Generate the whole // histogram and returns it as a string to be printed out in // the main function. Be default * will be used to create bars

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!