Hello,
I'm new to c++ and I have this problem.
1) Write a program to simulate rolling a pair of dice 100 times.
2) Write the logic so that:
** When the result is less than 6, display "....."
** When the result is 6, 7, or 8, display "......"
** When the result is greater than 8, display "....."
3) Record how many times each value (2, 3, 4, ...12) occurs and how many rolls in total.
4) Display the numbers of times each outcome occurred and its percent of the total numbers of rolls.
I am fine until I get to number 3... I'm drawing a blank on how to count how many times each number occurs. I have the total rolls figured out. And then I'm stuck on number 4 on how to count each outcome to figure out the percent.
** The bottom of my code is not complete I just typed out the cout where I will put the results from numbers 3 and 4
** And we haven't learned functions yet so I cant use anything like that.
Any help would be greatly appreciated!!
Thanks!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{
int die1, die2, total_dice, count, i;
srand(time(0));
count = 0;
for (i = 1; i <= 100; i++)
{
die1 = rand() % 6 + 1;
die2 = rand() % 6 + 1;
total_dice = die1 + die2;
cout << "Result from roll is: " << total_dice << endl;
count ++;
if (total_dice < 6)
{
cout << "Hypertron battery failure imminent, MAYDAY, MAYDAY!!" << endl;
cout << "" << endl;
}
if (total_dice == 6  total_dice == 7  total_dice == 8)
{
cout << "Normal function, continue operations" << endl;
cout << "" << endl;
}
if (total_dice > 8 )
{
cout << "I've never seen such performance, Dr. Spock. It's a miracle!!" << endl;
cout << "" << endl;
}
}
cout << "Total Rolls: " << count << endl;
cout << "" << endl;
cout << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
cout << "The number " << " " << " occured " << "" << " times and its
percentage of occurence is " << "" << endl;
return 0;
}
 