SHARE
TWEET

Untitled

a guest Jan 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace VendingMachine
  4. {
  5.     public class VendingMachine
  6.     {
  7.         public static void Main()
  8.         {
  9.             string command = Console.ReadLine();
  10.             int coinsInserted = 0;
  11.             int moneyAvailable = 0;
  12.  
  13.             while (command != "Start")
  14.             {
  15.                 coinsInserted = int.Parse(command);
  16.  
  17.                 if (coinsInserted != 0.1 ||
  18.                     coinsInserted != 0.2 ||
  19.                     coinsInserted != 0.5 ||
  20.                     coinsInserted != 1 ||
  21.                     coinsInserted != 2)
  22.                 {
  23.                     Console.WriteLine($"Cannot accept {coinsInserted}");
  24.                     continue;
  25.                 }
  26.                 moneyAvailable += coinsInserted;
  27.             }
  28.         }
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top