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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, hmontalvo22
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
image
Computers and Technology, 22.06.2019 23:00, nicog94
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, lm18618
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
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 in other subjects:

Konu
Mathematics, 31.07.2020 22:01
Konu
Mathematics, 31.07.2020 22:01