Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement