# Question 19 20 20 One Im Trying Figure Suppose Roll Set N Dice Smallest Sum N Largest 6n E Q10175431

question 19 and then 20( 20 is one im trying to figure out)

suppose you roll a set of n dice. then the smallest sum is n andthe largest is 6n. example if n=10 then the small sum will be 6 andthe largest 60. Let m be the desired sum of the numbers rolled.then n<= m <= 6n. write a program that uses the class die ofexample 10-9 to roll 10 die(will type it below the instruction).use an array of size 10 to implement 10 dice. the program promptsthe user to enter the desired sum and the number of the times thedice are to be rolled. the program outputs the number of times thedesired sum was rolled and the probability of the rolling thedesired sum .

question20

programing excersie 19 promted the user to imput the number oftmes the dice were to be rolled and the desired sum and the programoutput the number of times the desired sum occued. modifyprogamming exersie 19(the instructions from above),: suppose youroll 4 dice 1000 times. store the sum of the n umbers rolled ineach roll into an array and then use this array to pring a bargraph(sounds like me want to put the numbers into excell andconsturct a graph) test run your program use 4,5,6 dice and thenumber of rolls 2500, 3000, and 5000. what type of curve does theshape of your bar graph resemble?

class die

{

public:

die();

void roll();

int getNum() const;

private

int num;

};

die :: die()

{

num = 1;

srand(time(0));

}

void die::roll()

{

num = rand()% 6+1

}

int die:: getNum() const

{

return num;

}

if it helps the isbn is 9781285852751

## Leave a Reply

Want to join the discussion?Feel free to contribute!