Guest User

Untitled

a guest
Jul 30th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. using System;
  2. using System.Xml.Schema;
  3.  
  4. namespace ToyStore
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. double travelPrice = double.Parse(Console.ReadLine());
  11. int brSaw = int.Parse(Console.ReadLine());
  12. int brDoll = int.Parse(Console.ReadLine());
  13. int brBears = int.Parse(Console.ReadLine());
  14. int brMinions = int.Parse(Console.ReadLine());
  15. int brTrucks = int.Parse(Console.ReadLine());
  16.  
  17. double prSaw = 2.60;
  18. double prDoll = 3.00;
  19. double prBears = 4.10;
  20. double prMinnionts = 8.20;
  21. double prTrucks = 2.00;
  22.  
  23. int brtoys = brBears + brDoll + brMinions + brSaw + brTrucks;
  24. double total = (brDoll * prDoll + brBears * prBears + brSaw * prSaw + brTrucks * prTrucks + brMinions * prMinnionts);
  25. double totalAfterRent = total - total * 0.10;
  26. double left = totalAfterRent - travelPrice;
  27. double needed = travelPrice - totalAfterRent;
  28.  
  29.  
  30. if (brtoys >=50)
  31. totalAfterRent=totalAfterRent-0.25*totalAfterRent;
  32.  
  33.  
  34.  
  35. if (travelPrice <= total)
  36.  
  37. Console.WriteLine($"Yes! {left:f2} lv left.");
  38.  
  39. else if (travelPrice > totalAfterRent)
  40. {
  41. Console.WriteLine($"Not enough money! {needed:f2} lv needed.");
  42.  
  43. }
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. }
  52. }
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment