I've been having problems with my program. When I go to compile the program and enter a number to roll the dice the data given is wrong. For instance if I roll the dice once the output data will show a frequency of the total of 11 three times.
(j<=userChoice) j is initialized as 0, so if the user chooses 0 rolls it checks (0<=0) which returns true (because zero is equal to zero). If the user enters 1 then both (0<=1) and (1<=1) will return true. Change the <=
Also, you're not rolling the dice each loop iteration, I'm going to assume that's not your intent?
the program is a dice rolling simulator using functions. The object of the program is to ask the user how many times they wish to roll two six sided dice, which will then output how many times a total from 2-12 was rolled and the probability of each total.
the instruction diceTotal = rollDie(6) + rollDie(6); should be inside the while loop, otherwise you are rolling only one time. while (j<=userChoice) should be while (j<userChoice), otherwise you are rolling userChoice + 1 times.
Finally, the percentage calculations give you wrong results because of the integer divisions. You could do: