Hello; I was wondering if anyone could assist me with this problem. The end result should look like this:
Roll Testrun 1 Testrun 2 Total
1's 3 <25%> 6<50%> 9
bet on 1!
Basically it displays the amount of times a Dice roll landed on a number for a certain amount of Testruns. Its also supposed to display the percentages, so lets say the user input is 12 rolls, and 1 is rolled 3 times. That is 25 percent. The program does this for values of 1-6 for all testruns and then tallys up the total amount of times a number was rolled and tells the user to bet on the number that was rolled the highest amount of times. This is what I have so far:
using namespace std;
int main () {
srand (time(0));
int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
int roll;
int num;
cout<< "How many rolls per run test run?";
cin>> roll;
for (int run = 1; run <= 4; run++) {
for (int x = 1; x <= roll; x++)
{
num = (1+ rand()%6);
if (num == 1 ) (a++);
if (num == 2 ) (b++);
if (num == 3 ) (c++);
if (num == 4 ) (d++);
if (num == 5 ) (e++);
if (num == 6 ) (f++);
}