public SeniorCitizen(Screening screening, OptionAttempt attempt) : base(screening) { YearOfBirth = ((DateTime)attempt.Run(() => { Console.Write("Please enter year of birth [YYYY]: "); return(Utility.TryConvertingStringToDateTime(Console.ReadLine())); }, obj => { return(DateTime.Today.Year - 55 >= ((DateTime)obj).Year); })).Year; }
public Adult(Screening screening, OptionAttempt attempt) : base(screening) { PopcornOffer = attempt.Run(() => { Console.Write("Would you like to buy a popcorn set for $3.00 [Y/N]: "); return(Console.ReadLine().ToUpper()); }, obj => { return(obj.Equals("Y") || obj.Equals("N")); }).Equals("Y") ? true : false; }
public Student(Screening screening, OptionAttempt attempt) : base(screening) { LevelOfStudy = (String)attempt.Run(() => { Console.Write("Please enter level of study [Primary/Secondary/Tertiary]: "); return(Console.ReadLine().ToUpper()); }, obj => { return(obj.Equals("PRIMARY") || obj.Equals("SECONDARY") || obj.Equals("TERTIARY")); }); }