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, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
Is a type of bullying that takes place when a person intentionally posts negative information about another person that is not true.
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
The hybrid uses 144 to 158 volt batteries.
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
Mathematics, 29.07.2019 03:00
question
Social Studies, 29.07.2019 03:00
Questions on the website: 13722363