Question: C# - Printing the return value of a method within a class to the console. Please see the ******* part for what I am trying
C# - Printing the return value of a method within a class to the console.
Please see the ******* part for what I am trying to do. Could you also please explain what I was doing wrong with my main method.
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace DiceRoller { public class Die { static void Main(string[] args) { ***** I want to do Console.WriteLine here that displays the returned value in GetFaceValue() Console.ReadLine(); } private const int SIX_SIDED = 6; private const int DEFAULT_FACE_VALUE = 1; private const int MIN_FACES = 3; ///
public Die() { numFaces = SIX_SIDED; faceValue = DEFAULT_FACE_VALUE; }
///
if (faces >= MIN_FACES) { numFaces = faces; } else { numFaces = SIX_SIDED; }
RollDie(); }
///
///
}// end Class Die }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
