Ejemplo n.º 1
0
 public string dispenseKeys()
 {
     if (automat.getCount() <= 0)
     {
         automat.setState(automat.getFullyRentedState());
     }
     else
     {
         automat.setState(automat.getWaitingState());
     }
     return("Here are your keys!");
 }
Ejemplo n.º 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.");
        }
Ejemplo n.º 3
0
 public string gotApplication()
 {
     automat.setState(automat.getGotApplicationState());
     return("Thanks for the application.");
 }