Пример #1
0
 public string dispenseKeys()
 {
     if (automat.getCount() <= 0)
     {
         automat.setState(automat.getFullyRentedState());
     }
     else
     {
         automat.setState(automat.getWaitingState());
     }
     return("Here are your keys!");
 }
Пример #2
0
        public string checkApplication()
        {
            int yesno = random.Next() % 10;

            if (yesno > 4 && automat.getCount() > 0)
            {
                automat.setState(automat.getApartmentRentedState());
                return("Congratulation,you're approved.");
            }
            automat.setState(automat.getWaitingState());
            return("Sorry,you're not approved.");
        }