Question: Need help solving and understanding in c + + please use the frame below to solve in C + + #include #include GVDie.h using

Need help solving and understanding in c++ please use the frame below to solve in C++
#include
#include "GVDie.h"
using namespace std;
int main(){
int goal;
int credits;
int rounds;
int seed;
int total;
GVDie die1= GVDie();
GVDie die2= GVDie();
// Read random seed to support testing (do not alter)
cin >> seed;
srand(seed);
// Read starting credits
cin >> credits;
/* Type your code here */
return 0;
}
Program Specifications Write a program to play an automated dice game that uses two dice (GVDie class provided). The player rolls both
dice and either wins one credit, loses one credit, or sets a goal for future rolls. The current round ends when player wins or loses a credit.
The game ends when credits are zero.
Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only
a portion of tests pass after each step but confirm progress.
Step 0. Read starter template and do not change the provided code. Two GVDie objects are created. A random seed is read from input and
used to initialize a sequence of random numbers. This supports automated testing and creates predictable results that would otherwise be
random. Starting credits is read from input.
Step 1(3 pts). Roll both dice. Player wins one credit by rolling 7 or 11. Player loses one credit by rolling 2,3, or 12. Otherwise, credits do not
change and the player's goal is set to the dice total. The player's goal must be repeated in Step #2 to win a credit. The GVDie class includes
Roll() and GetValue() functions. Output dice total and credits. Submit for grading to confirm 3 tests pass.
Ex: If input is:
42,10
Sample output is:
Dice total: 2
Credits: 9
Step 2(4 pts). If player did not win or lose in step 1(i.e. a goal was set), continue rolling both dice until one of two outcomes: 1) player rolls
a 7 and loses one credit or 2) player rolls the goal value and wins one credit. Current round ends. Set goal to -1 and output credits. Submit
for grading to confirm 5 tests pass.
Ex: If input is:
577
Sample output is:
Step 3(3 pts). Add a loop to repeat steps 1 and 2 until credits are zero. Count and output the number of rounds when game is over. Submit
for grading to confirm all tests pass.
Ex: If input is:
734
Sample output ends with:
Need help solving and understanding in c + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!