Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TaxCalculator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double buget = double.Parse(Console.ReadLine());
  10. string text = Console.ReadLine();
  11. double price = 0;
  12. double moneyLeft = 0;
  13. while (text == "Finish")
  14. {
  15.  
  16. if (text == "Star")
  17. {
  18. price = 5.69;
  19. }
  20. else if (text == "Angel")
  21. {
  22. price = 8.49;
  23. }
  24. else if (text == "Lights")
  25. {
  26. price = 11.20;
  27. }
  28. else if (text == "Wreath")
  29. {
  30. price = 15.50;
  31. }
  32. else if (text == "Candle")
  33. {
  34. price = 3.59;
  35. }
  36. text = Console.ReadLine();
  37. if (text == "Finish")
  38. {
  39. Console.WriteLine("Congratulations! You bought everything!");
  40.  
  41. }
  42. else
  43. {
  44. moneyLeft = price - buget;
  45. Console.WriteLine($"Not enough money! You need {moneyLeft}lv more.");
  46.  
  47. }
  48.  
  49.  
  50. }
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement