Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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"));
     });
 }