Ejemplo n.º 1
0
 public static void BuyProduct(int keyPush, int latestKeyPush)
 {
     if (ProductStock.CheckSupply(keyPush))
     {
         Vending.DetailTheExchange(keyPush, latestKeyPush);
     }
     else
     {
         ConcatenateCurrentMessage($"We have run out of {ProductStock.ShowProductInfo(keyPush).ProductName}");
     }
 }
Ejemplo n.º 2
0
        public static void ReceiveAmount(int moneyInserted)
        {
            Vending.IncreaseDebtToCustomer(moneyInserted);

            switch (moneyInserted)
            {
            case 1:
                moneyAvailable[7]++;
                break;

            case 5:
                moneyAvailable[6]++;
                break;

            case 10:
                moneyAvailable[5]++;
                break;

            case 20:
                moneyAvailable[4]++;
                break;

            case 50:
                moneyAvailable[3]++;
                break;

            case 100:
                moneyAvailable[2]++;
                break;

            case 500:
                moneyAvailable[1]++;
                break;

            case 1000:
                moneyAvailable[0]++;
                break;

            default:

                break;
            }
        }
Ejemplo n.º 3
0
 public static void EndSession()
 {
     Vending.SettleDebtToCustomer();
     Display.PowerDownDisplay();
     activityState = "energy save mode";
 }
Ejemplo n.º 4
0
 public static void ReleaseFullAmount(int[] coinReturn, int[] banknoteReturn) //This represents the physical action
 {
     Vending.BalanceDebtByMoneyBack();
     amountToReturn = 0;
 }
Ejemplo n.º 5
0
 public static void DisplayCurrentMessage()
 {
     Console.WriteLine("Welcome");
     Console.WriteLine("You have {0} kr", Vending.RevealDebtToCustomer());
     Console.WriteLine(currentMessage);
 }