HELP! Need to create a program that simulates a dice roll using arrays
I'm taking a class in programming in C++ and we have to make the following program:
--Write a program that will simulate the roll of two dice (use the random number generator). Ask the user how many times the user wants to roll the dice, n. Simulate the roll of the dice n times and calculate the sum. Count how many times each sum is rolled. Note that the sums range form 2 (1+1) to 12 (6 + 6). 7 should be rolled the most and 2 and 12 the least. Output how many times each sum was rolled.
The highlighted part above is the part that has me the most confused.
My teacher says we can't use an "if" statement and I'm not quite sure where to start.
Re: HELP! Need to create a program that simulates a dice roll using arrays
Well, i figured it out...thanks anyway
|All times are GMT +5.5. The time now is 00:06.|