![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 24.12.2019 18:31 lukevader311
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](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
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](/tpl/images/cats/informatica.png)
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](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 22:01
![Konu](/tpl/images/cats/health.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 22:01
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 22:01
![Konu](/tpl/images/cats/mat.png)
Mathematics, 31.07.2020 22:01
![Konu](/tpl/images/cats/istoriya.png)