Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to play a dice game against the computer. The game is very simpl

ID: 3543506 • Letter: W

Question

Write a program to play a dice game against the computer. The game is very simple. You will place a

wager of tokens. The computer rolls a dice and you roll a dice. If your dice is greater in value than the

computer's dice you win your wager. If the computer's dice is greater in value than yours, the

computer wins. Nobody wins in a tie.      Programing in C

To generate random numbers:

a) Include stdlib.h and time.h in your preprocessor directives

b) In the main body of the program, after all variables have been initialized use the srand()

function to seed your random number generator rand().

c) srand(time(NULL));

d) more_statements;

e) Dice = (rand() % 6) + 1; /* random number 1 to 6 */

Explanation / Answer


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote