title: Having issues getting an inherited class working properly
body: <p>Here is my base class :</p>
  
  <pre><code>    class Pet
      {
          //class internal variables
          string petName;
          bool gender;  //true = female; false = male
          DateTime dob;
          int goodDogs = 0;
          int goodCats = 0;
          int goodKids = 0;
  
          //constructors
          public Pet(string pn, bool g, DateTime birth, int d, int c, int k)
          {
              petName = pn;
              gender = g;
              dob = birth;
              goodDogs = d;
              goodCats = c;
              goodKids = k;
          }
  
          public Pet(string pn, string g, DateTime birth, int d, int c, int k)
          {
              petName = pn;
              if (g.ToLower() == "female")
              {
                  gender = true;
              }
              else
              {
                  gender = false;
              }
              dob = birth;
              goodDogs = d;
              goodCats = c;
              goodKids = k;
          }
  
          //Properties
          public string PetName
          {
              get
              {
                  return petName;
              }
              set
              {
                  petName = value;
              }
          }
  
          public string Gender
          {
              get
              {
                  if (gender == true)
                  {
                      return "Female";
                  }
                  else
                  {
                      return "Male";
                  }
              }
              set
              {
                  if (value.ToLower() == "female")
                  {
                      gender = true; 
                  }
                  else
                  {
                     gender = false;
                  }
              }
          }
  
          public DateTime DOB
          {
              get
              {
                  return dob;
              }
              set
              {
                  dob = value;
              }
          }
  
          public string GoodWithDogs
          {
              get
              {
                  switch (goodDogs)
                  {
                      case 1:
                          return "Yes";
                          //break;
                      case 2:
                          return "No";
                          //break;
                      default:
                          return "Unknown";
                          //break;
                  }
  
              }
              set
              {
                  goodDogs = int.Parse(value);
              }
          }
  
          public string GoodWithCats
          {
              get
              {
                  switch (goodCats)
                  {
                      case 1:
                          return "Yes";
                      //break;
                      case 2:
                          return "No";
                      //break;
                      default:
                          return "Unknown";
                      //break;
                  }
  
              }
              set
              {
                  goodCats = int.Parse(value);
              }
          }
  
          public string GoodWithKids
          {
              get
              {
                  switch (goodKids)
                  {
                      case 1:
                          return "Yes";
                      //break;
                      case 2:
                          return "No";
                      //break;
                      default:
                          return "Unknown";
                      //break;
                  }
  
              }
              set
              {
                  goodKids = int.Parse(value);
              }
          }
  
         // Methods
          public string GetAge()
          {
              DateTime currentDate = System.DateTime.Now;
              TimeSpan daysPassed = currentDate - dob;
              int ageInDays = daysPassed.Days;
              if (ageInDays &lt; 350)
              {
                  return (Math.Round(ageInDays / 30.0)).ToString() + " months";
              }
              else
              {
                  return (ageInDays / 365).ToString("N1") + " years" ; 
              }
          }
      }
  
  Here is what I have for my class that is trying to inherit:
  
  public class Cat : Pet
  {
      private string breed;
      private bool litterBoxTrained;
      private bool declawed;
  
      public Cat(string pn, string g, DateTime birth, int d, int c, int k,string b, bool lbt, bool dc) 
      : base ( pn, g, birth, d, c, k)
      {
          breed = b;
          litterBoxTrained = lbt;
          declawed = dc;
      }
  
      public string Breed
      {
          get
          {
              return breed;
          }
          set
          {
              breed = value;
          }
      }
  
      public string HouseBroke
      {
          get
          {
              if (litterBoxTrained == true)
              {
                  return "Yes";
              }
              else
              {
                  return "No";
              }
          }
          set
          {
              if (value.ToLower() == "yes")
              {
                  litterBoxTrained = true;
              }
              else
              {
                  litterBoxTrained = false;
              }
          }
      }
  
      public string BasicCommand
      {
          get
          {
              if (declawed == true)
              {
                  return "Yes";
              }
              else
              {
                  return "No";
              }
          }
          set
          {
              if (value.ToLower() == "yes")
              {
                  declawed = true;
              }
              else
              {
                  declawed = false;
              }
          }
      }
      public string InfoListing()
      {
  
          return string.Format("{0,-6}{1:-15}{2,-9}{3,-24}{4:-12}", "CAT", petName, gender, breed, base.GetAge());
      }
  }
  </code></pre>
  
  <p>I am having issues with protection.  I am getting inconsistent class protection error and two errors trying to access the inherited variable petName and inherited method GetAge().  One of the caveats is that I am not allowed to alter the base (pet) class code.</p>
  
  <p>Any advivce would be great.  Thank You </p>