Question: 9 . 5 0 LAB: Rolling for a pair Given two GVDie objects that represent 2 six - sided dice and an integer that represents
LAB: Rolling for a pair
Given two GVDie objects that represent sixsided dice and an integer that represents a desired value as parameters, complete the function
RollingForPair in the main class. The main class rolls the dice until a pair with the desired value is rolled. The function RollingForPair then
returns the number of rolls thrown to achieve the result. Assume the desired value received from input is within the appropriate range,
Note: For testing purposes, the GVDie objects are created in the main function using a pseudorandom number generator with a fixed
seed value. The program uses a seed value of during development, but when submitted, a different seed value will be used for each test
case.
Ex If the GVDie objects are created with a seed value of and the input of the program is:
the output is:
It took rolls to get a pair of s
LAB
ACTIVITY
: LAB: Rolling for a pair
Current file: main.cpp
Load default template...
#include "Gvule.h
using namespace std;
int RollingForPairGVDie d GVDie d int val
Type your code here
int main
GVDie GVDie;
GVDie GVDie;
dSetSeed; Create a GVDie object with seed value
dSetSeed; Create a GVDie object with seed value
int rolls;
int val;
cin val;
rolls RollinoForPaird d yall:
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
