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