Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started