Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago