Thread: C programming question.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2015
    Posts
    2

    Exclamation C programming question.

    I hope I can have some help on this question:

    You are to write a C program that would roll from 1 to 3 dices for 1 to 5 players of

    board games like snakes and ladders and Monopoly.The program would give you the option to choose to have from 1 to 5 players (prompt
    players for their names) and you should also be able to choose to roll between 1, 2,
    or 3 dices. For example, if the option of 3 dices were chosen, the roll would display
    the count of dice 1, 2, and 3 individually PLUS the sum of all 3 the dices. E.g. say,
    the roll of Player Adriano is 2, 6, 4 as shown in the picture on the top right corner of
    this page, the roll should be displayed as below:
    Player Adriano Roll 1: 2, 6, 4  12
    Where 12 is the sum of the roll (2+6+4).
    You are to save the dice roll in a text file (a .txt file) as recording of the dice roll. The
    text file would also record some simple statistics of the rolls for each individual
    player, e.g. most frequently number rolled, average roll, and the percentage of roll.
    Eg. In 10 rolls, player Adriano, most frequently rolled 6 on 2 dices, average roll is
    6.3, and roll 2 2% of the time, 3 4% of the time, 4 7% of the time … and 12 2% of the
    time on 2 dices. The computation should only be done when the user choose to quit
    the program, as that is also the only time you have enough data to compute the
    statistics and store it in the text file.
    Consider also the common board games rule:-
    1. If 1 dice is used, the player can roll again if he/she rolled a 6 (six), up to 3
    times.
    2. If 2 dices were used, the player can roll again if he/she rolled a double (up to
    3 times).
    3. If 3 dices were used, the player can roll again if he/she rolled a triple (up to 3
    Attached Images Attached Images

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Programming Question
    By Buddha in forum C Programming
    Replies: 11
    Last Post: 05-17-2010, 03:02 PM
  2. Programming question
    By cagayanamerican in forum C++ Programming
    Replies: 8
    Last Post: 09-30-2005, 04:39 PM
  3. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM
  4. UIL Programming Question
    By araknid in forum C++ Programming
    Replies: 7
    Last Post: 02-11-2002, 08:11 PM

Tags for this Thread