Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

>> 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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Solve for the indicated letter. 1-3 b t 2b - 1 =fo for t 2

Answered: 1 week ago

Question

5. A review of the key behaviors is included.

Answered: 1 week ago