Question: >> IN C PROGRAMMING LANGUAGE ONLY COPY OF DEFAULT CODE, ADD SOLUTION INTO CODE IN C #include #include #include #include GVDie.h int RollSpecificNumber(GVDie die, int

>> IN C PROGRAMMING LANGUAGE ONLY

 >> IN C PROGRAMMING LANGUAGE ONLY COPY OF DEFAULT CODE, ADD

COPY OF DEFAULT CODE, ADD SOLUTION INTO CODE IN C

#include #include #include

#include "GVDie.h"

int RollSpecificNumber(GVDie die, int num, int goal) { /* Type your code here. */ }

int main() { GVDie die = InitGVDie(); // Create a GVDie variable die = SetSeed(15, die); // Set the GVDie variable with seed value 15 int num; int goal; int rolls; scanf("%d", &num); scanf("%d", &goal); rolls = RollSpecificNumber(die, num, goal); // Should return the number of rolls to reach total. printf("It took %d rolls to get a \"%d\" %d times. ", rolls, num, goal);

return 0; }

Complete function RollSpecificNumber0 that has three parameters: a GVDie struct object, an integer representing a desired face number of a die, and an integer representing the goal amount of times to roll the desired face number. The function RollSpecificNumber() then rolls the die until the desired face number is rolled the goal amount of times and returns the number of rolls required. Note: For testing purposes, a GVDie struct object is created in the main( function using a pseudo-random number generator with a fixed seed value. The program uses a seed value of 15 during development, but when submitted, a different seed value will be used for each test case. Ex: If a GVDie struct object is created with a seed value of 15 and the input of the program is

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 Databases Questions!