Question: In this lab, using C++, you will implement the program you designed in Lab 2. You will create the Die, LoadedDie and Game classes. You
In this lab, using C++, you will implement the program you designed in Lab 2. You will create the Die, LoadedDie and Game classes. You will use them in the simple dice rolling game. Die class: requires an input integer N which determines the number of sides on the individual die. It includes a method to return a random integer between 1 and N as the result of rolling the die for once. LoadedDie class: it inherits the behavior and elements of Die, but the number it returns is biased such that the average output of rolling it for several times will be higher than for a Die object. You can determine how you want to realize the biased function. Game class: it will implement the simple dice-rolling game. In the menu function, the user will specify the die sides used by each player (the players can have dice with different number of sides). The user will also indicate if either or both players are using loaded dice, and will enter the number of rounds in the game. The Game class will create the necessary objects, play the game, and display the results to the user. The output results should indicate the side and type (loaded or not) of die used for each player, the number of rounds won by each player (in each round, compare the rolling results, the larger number will win), and the final winner of the game (the player that win more rounds).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
