HELP! Need to create a program that simulates a dice roll using arrays

Discussion in 'C' started by DeepSix, Apr 17, 2008.

  1. DeepSix

    DeepSix New Member

    Joined:
    Apr 17, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. DeepSix

    DeepSix New Member

    Joined:
    Apr 17, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Well, i figured it out...thanks anyway
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice