Question: Coding in C# Sample Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DiceRoller { public class Die { // You should include your

Coding in C#

Coding in C# Sample Code: using System; using System.Collections.Generic; using System.Linq; using

Sample Code:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DiceRoller { public class Die { // You should include your Die class from the previous exercise here }// end class Die public class Dice { // Implement your 'Dice' class here // ... }// end class Dice }

Requirements: n week 5 you were asked to create a Die' class. This class simulated the rolling of a single die, which can have a variable number of sides, and the number of sides is passed to the on construction our task this week is to create a Dice' class which contains a collection of Die' as a private variable and simulates the rolling of multiple dice ou should include your Die' class in the code, in the same namespace as the Dice' class, and make a private variable to store an array of these Die in the Dice' class. e Dice' class must have 2 constructors: ublic Dice(int dice) is constructor creates an instance of Dice with the specified number of dice. These dice should have the same default number of faces as the Die' class (6), and the same default ace value (1) ublic Dice(int dice, int faces) is constructor creates an instance of Dice with the specified number of dice, each with faces number of faces, and the same default face value as the "Die class (1). As with the ie' class, the minimum number of faces is 3 e class must also have two other methods, which are similar to the methods of the Die class ublic void RollDice() his method must roll the dice ublic int GetFaceValue() is method must return the total face value of all the dice (e.g. if there was 2 dice with face values 3 and 6, this should return 9) ow, given the defaults, the code Dice myDi ce = new Dice(1); should create a single six-sided die, and rolling this should produce values between 1 and 6 ice myDice new Dice(2, 4);, however, should create two four-sided dice. Rolling these dice should produce values between 2 and 8 ote that no Main() function is provided. You should create your own Main() function for debugging your new class. Your Dice class will be instantiated and its methods called the AMS in order to test it f you still have difficulties, here are some tips when writing programs for AMS Do not write your program directly into the text box. You should copy and paste the sample code into Visual Studio, write your program there, run it and test it to make sure it works, then paste it into AMS. You only get a limited number of attempts at each AMS exercise, so make sure they count. Requirements: n week 5 you were asked to create a Die' class. This class simulated the rolling of a single die, which can have a variable number of sides, and the number of sides is passed to the on construction our task this week is to create a Dice' class which contains a collection of Die' as a private variable and simulates the rolling of multiple dice ou should include your Die' class in the code, in the same namespace as the Dice' class, and make a private variable to store an array of these Die in the Dice' class. e Dice' class must have 2 constructors: ublic Dice(int dice) is constructor creates an instance of Dice with the specified number of dice. These dice should have the same default number of faces as the Die' class (6), and the same default ace value (1) ublic Dice(int dice, int faces) is constructor creates an instance of Dice with the specified number of dice, each with faces number of faces, and the same default face value as the "Die class (1). As with the ie' class, the minimum number of faces is 3 e class must also have two other methods, which are similar to the methods of the Die class ublic void RollDice() his method must roll the dice ublic int GetFaceValue() is method must return the total face value of all the dice (e.g. if there was 2 dice with face values 3 and 6, this should return 9) ow, given the defaults, the code Dice myDi ce = new Dice(1); should create a single six-sided die, and rolling this should produce values between 1 and 6 ice myDice new Dice(2, 4);, however, should create two four-sided dice. Rolling these dice should produce values between 2 and 8 ote that no Main() function is provided. You should create your own Main() function for debugging your new class. Your Dice class will be instantiated and its methods called the AMS in order to test it f you still have difficulties, here are some tips when writing programs for AMS Do not write your program directly into the text box. You should copy and paste the sample code into Visual Studio, write your program there, run it and test it to make sure it works, then paste it into AMS. You only get a limited number of attempts at each AMS exercise, so make sure they count

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!