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 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
question
Computers and Technology, 25.06.2019 08:00
Beginning in the 1940s, first-generation computers used circuitsvacuum tube technologylaser technologytransistors
Answers: 2
question
Computers and Technology, 25.06.2019 08:20
The internet backbone is a foundation network linked with
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
English, 28.08.2021 06:20
question
Mathematics, 28.08.2021 06:20
question
English, 28.08.2021 06:20
question
English, 28.08.2021 06:20
question
Mathematics, 28.08.2021 06:20
Questions on the website: 13722363