subject

Hello, i've created the dice class and dice. cpp file for the following set of instructions, i only need implemented the diceandanger. cpp and diceanddanger_test. cpp feel free to make any

with this program, you will begin the practice of breaking source code into distinct modules that are responsible for limited scopes of behavior and data. you will create the framework of a game that uses dice to generate random decisions. this game is called diceanddanger. cpp.

create a class (header and implmentation files) named dice that can be used to create objects that simulate the behavior of one or more die. this class should be able to simulate a die with an arbitrary number of sides; for example, it should be able to simulate a three sided die or a 21 sided die.

this class must have at least two public methods:

void roll() - which will simulate rolling a die by returning a random number between 1 and n where n represents the number of sides on the die.

int read() - which will return the value showing on the "top" of the die. this value represents the number of "pips" on the face of the die considered to be the top. if you store the values of the faces of your die in an array, the top should be the first element.

int read(int n) - return the value associated with the nth side of the die.

your class must have a default constructor that will create a die with 6 sides. it should also have a parameterized constructor which will take an argument that indicates the number of sides that the new die object should contain.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
Write a function 'music_func' that takes 3 parameters -- music type, music group, vocalist -- and prints them all out as shown in the example below. in case no input is provided by the user, the function should assume these values for the parameters: "classic rock", "the beatles", "freddie mercury". for example: input: alternative rock,pearl jam,chris cornell output: the best kind of music is alternative rock the best music group is pearl jam the best lead vocalist is chris cornell note: the print statements will go inside the for example: print("the best kind of music is"
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Write a function named printfloatrepresentation(float number) that will print the floating point representation of a number using the format given below. (sign bit) exponent in binary (assumed bit).significandfor example if the number passed an argument is 71 yourprogram should print (0) 10000101 (1).00011100000000000000000similarly if the number passed to the function as argument is -71 the program should print (1) 10000101 (1).00011100000000000000000
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
You know the right answer?
Hello, i've created the dice class and dice. cpp file for the following set of instructions, i only...
Questions
question
Physics, 21.06.2020 05:57