title: Create a Date class with fields day, month and year. (You cannot use the built-in DateTime class from .NET Library)
body: <p>I'm trying to create properties corresponding to these fields, but I'm having trouble making the logic for setting the correct day,month and year without using the DateTime class. </p>
  
  <p>So the user will enter the data one at a time: Day, Month and Year in that order.</p>
  
  <p>And the day should be between 1 and 30 or 31 or 28 -  based on the month. Month must be between 1 and 12 and the Year must be less than or equal to 2013</p>
  
  <p>Then I need to make a test case that will take the 3 values of day, month, and year and make an instance of date.</p>
  
  <p>Then I have to create a Sentinel controlled loop to ask the user to enter the day, month and year and create an instance the Date with the user input using the constructor. and Terminate the program if the user enters 0 for the day, month or year.</p>
  
  <p>I am mostly having trouble getting the logic down.</p>
  
  <pre><code>public class Date
  {
     public int Month { get; set; }
  
     public int Day { get; set; }
     public int Year { get; set; }
  
     public Date ( int monthValue, int dayValue, int yearValue)
     {
         Month = monthValue;
         Day = dayValue;
         Year = yearValue;
     }
     public int theMonth
     {
         get {return Month;} 
  
         set
         {
             if (value &lt;= 12) Month = value;
  
         }
  
      }
     public int theDay
     {
         get { return theDay; }
         set
         {
             if (value &lt;= 30) Day = value;
             else if (value == 31) Day = value;
             else if (value == 28) Day = value;
         }
     }
  
  
     public override string ToString()
     {
          return String.Format( "{0}/{1}/{2}", Month, Day, Year);
     }
  }
  </code></pre>