const int MAX_STOMACH_LEVEL = 3;
const int MAX_BLADDER_LEVEL = 5;
string _firstName = null;
GenderType _gender = GenderType.Undefined;
return _stomachLevel >= MAX_STOMACH_LEVEL;
return _bladderLevel >= MAX_BLADDER_LEVEL;
if (String.IsNullOrWhiteSpace(value))
throw new ArgumentException("Name cannot be empty.");
_firstName = value.Trim();
get { return _lastName; }
if (String.IsNullOrWhiteSpace(value))
throw new ArgumentException("Name cannot be empty.");
_lastName = value.Trim();
public GenderType Gender {
if (value == GenderType.Undefined)
throw new ArgumentException("Gender cannot be undefined.");
public Body(string firstName, string lastName, GenderType gender)
this.FirstName = firstName;
this.LastName = lastName;
Console.WriteLine("Yum!");
Console.WriteLine("I'm full! Maybe I should do something about that.");
Console.WriteLine("Bellllch!");
Console.WriteLine("I'm not thirsty! Maybe I should do something about that.");
Console.WriteLine("Ahhhhh... I feel ten pounds lighter!");
Console.WriteLine("I don't have to poop.");
Console.WriteLine("Ahhhhh... Relief!");
Console.WriteLine("I don't have to pee.");
public override string ToString()
return String.Format("{0} {1}", this.FirstName, this.LastName);
public bool IsInSchool { get; set; }
public Child(string firstName, string lastName, GenderType gender) : base (firstName, lastName, gender)
public Child(string firstName, string lastName, GenderType gender, bool isInSchool) : base (firstName, lastName, gender)
this.IsInSchool = isInSchool;
var Jared = new Child("Jared", "Wooten", Body.GenderType.Male, true);
public bool IsEmployed { get; set;}
public Adult(string firstName, string lastName, GenderType gender) : base (firstName, lastName, gender)
public Adult(string firstName, string lastName, GenderType gender, bool isEmployed) : base (firstName, lastName, gender)
this.IsEmployed = isEmployed;
void DoctorCheckup(BodyPerson)
Console.WriteLine("Thanks for visiting the pediatrician!");
else if (person is Adult)
Console.WriteLine("Thanks for visiting the chiropractor.");
void GoDrinking(Body person)
Console.WriteLine("No kids allowed!");
else if (person is Adult)
Console.WriteLine("Coors Light on special!")
Console.WriteLine("Sorry, I couldn't verify your ID.");
var Daishaun = new Child ("Daishaun", "Rahimazadeh", Body.GenderType.Male);