Random n sided dice, number generator A dice is an n-sided shape with the sides labelled by numbers 1, 2,. . .,n. The most common dice used to play various games is the 6-sided dice. You can however have a dice that has many more sides. Write a C++ program that rolls multiple diced= 1,2, . . .9, outputs each dice’s roll and the sum of all the rolled dice. At each turn when the dice are rolled, all the dice have the same number of sides n. Your code must do the following
Random n sided dice, number generator A dice is an n-sided shape with the sides labelled by numbers 1, 2,. . .,n. The most common dice used to play various games is the 6-sided dice. You can however have a dice that has many more sides. Write a C++ program that rolls multiple diced= 1,2, . . .9, outputs each dice’s roll and the sum of all the rolled dice. At each turn when the dice are rolled, all the dice have the same number of sides n. Your code must do the following
•read in a number d-n from a file namedinput.txt, which represents the number of dice d and sides n each dice has, then
•generate a random number that would be found on each dice. Write the corresponding numbers from each dice, as well as the sum of all the numbers on each dice to a file namedoutput.txt
Step by step
Solved in 2 steps with 1 images