I would deeply appreciate it if someone can help me with this program because I have no idea how to do it and I need to get it done very soon.
I appreciate any bit of help ,and thank you all

_________________________________________________________________
Write a program that simulates rolls of two dice. The user will enter the number of rolls to
simulate. The program will keep track of the frequency each number on a single die appears and
the frequency of each sum of the two dice appears. Once the rolls are completed the program
will plot a histogram of the results using a * to represent each percentage of frequency
(fractions of a percentage should be rounded down using the function double floor(double)
in <math.h>).
Ensure that the program catches any errors in the user input (e.g. invalid inputs like characters
and values less than one).
Example using 10 dice rolls
Assume the dice rolls in the following table
Die1 4 6 3 6 2 3 1 2 5 2
Die2 5 2 5 4 5 3 6 2 6 3
Sum 9 8 8 10 7 6 7 4 11 5
Looking at the results of die1 and die2 we see that the number 1 appears once out of the 20
results (i.e. 5.0% time). The number 2 appears 5 times out of the 20 results (i.e. 25% of the
time). Out of the 20 results, the number 3, 4, 5, and 6 appears 4, 2, 4 and 4 times, respectively
(i.e. 20%, 10%, 20%, and 10%, respectively). The sum of the two dice varies between 2 and 12.
Out of the 10 sums, the sum 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 appears 0, 0, 1, 1, 1, 2, 2, 1, 1, 1,
and 0 times, respectively (i.e. 0%, 0%, 10%, 10%, 10%, 20%, 20%, 10%, 10%, 10%, and 0%,
respectively. The program output would be:
Enter the number of rolls: 10
One die
1 ( 5.0%) : *****
2 (25.0%) : *************************
3 (20.0%) : ********************
4 (10.0%) : **********
5 (20.0%) : ********************
6 (20.0%) : ********************
Two dice
2 ( 0.0%) :
3 ( 0.0%) :
4 (10.0%) : **********
5 (10.0%) : **********
6 (10.0%) : **********
7 (20.0%) : ********************
8 (20.0%) : ********************
9 (10.0%) : **********
10 (10.0%) : **********
11 (10.0%) : **********
12 ( 0.0%) :
Example using 10000 dice rolls
Enter the number of rolls: ten thousand
Invalid entry. Try again.
Enter the number of rolls: -10000
Must enter a number greater than 0!
Enter the number of rolls: 10000
One die
1 (16.8%) : ****************
2 (16.8%) : ****************
3 (16.7%) : ****************
4 (16.6%) : ****************
5 (16.5%) : ****************
6 (16.8%) : ****************
Two dice
2 ( 2.8%) : **
3 ( 5.5%) : *****
4 ( 8.6%) : ********
5 (11.6%) : ***********
6 (13.5%) : *************
7 (16.9%) : ****************
8 (13.7%) : *************
9 (10.4%) : **********
10 ( 8.4%) : ********
11 ( 5.7%) : *****
12 ( 2.9%) : **

This article has been dead for over six months. Start a new discussion instead.