Question: OverviewFor this assignment, write a C program to play an automated dice game that uses two dice ( GVDie classprovided ) . The player rolls
OverviewFor this assignment, write a C program to play an automated dice game that uses two dice GVDie classprovided The player rolls both dice and either wins one credit, loses one credit, or sets a goal for futurerolls. The current round ends when player wins or loses a credit. The game ends when credits are zero. Read the provided starter template and do not change the provided code. Two GVDie objects arecreated. The GVDie class includes Roll and GetValue functions. Ask the user to input a positive integer. Scan in this integer and use it as a random seed is read toinitialize a sequence of random numbers. This supports automated testing and creates predictableresults that would otherwise be random. Ask the user to input a positive integer representing the initial number of credits. Read in the usersinput. Roll both dice. Rolling or wins one credit. Rolling or loses a credit. If no credits are won or lost rolling a or credits do not change and the playersgoal is set to the dice total. If player did not win or lose in step ie a goal was set continue rolling both dice until one oftwo outcomes: player rolls a and loses one credit or player rolls the goal value and wins onecredit. A this point, the current round ends. Set goal to and output credits. Add a loop to repeat this process until available credits are zero. Count and output the number ofrounds when game is over. Output dice total and credits at each roll. Sum and output the number of rounds when the game is finished. Your output should match the sample run below.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
