Menu

Rolling Die Write Non Static Class Represent Die Call Class Die Die Class Two Private Fiel Q43899885

Rolling a Die Write a non-static class to represent a die. Call the class Die. The Die class should have two private fields •

Rolling a Die Write a non-static class to represent a die. Call the class Die. The Die class should have two private fields • _faceValue: Represents the current face value on the Die object • numSides: Represents the total number of sides on the Die object The Die class should have two constructors: • public Die(): Creates a new Die object with 6 sides • public Die(int numSides): Creates a new Die object with numSides sides The Die class should have a method to roll the Die: • public void Rolldie(): Sets the faceValue to a random sensible value for this Die object The Die class should have two getter methods for accessing the private fields: • public ??? GetFaceValue() • public ??? GetNumSides) using System; namespace DieRoller // Create the Die class // and fill it with the required members 11… public class Program public static void Main() Die myDie = new Die(); Show transcribed image text Rolling a Die Write a non-static class to represent a die. Call the class Die. The Die class should have two private fields • _faceValue: Represents the current face value on the Die object • numSides: Represents the total number of sides on the Die object The Die class should have two constructors: • public Die(): Creates a new Die object with 6 sides • public Die(int numSides): Creates a new Die object with numSides sides The Die class should have a method to roll the Die: • public void Rolldie(): Sets the faceValue to a random sensible value for this Die object The Die class should have two getter methods for accessing the private fields: • public ??? GetFaceValue() • public ??? GetNumSides) using System; namespace DieRoller // Create the Die class // and fill it with the required members 11… public class Program public static void Main() Die myDie = new Die();

Expert Answer


Answer to Rolling a Die Write a non-static class to represent a die. Call the class Die. The Die class should have two private fie…

OR