Advertisement
StellaIv

Untitled

Oct 20th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Toy_Shop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double priceForTrip = double.Parse(Console.ReadLine());
  10. int puzzelsCount = int.Parse(Console.ReadLine());
  11. int dollsCount = int.Parse(Console.ReadLine());
  12. int TeddyBearsCount = int.Parse(Console.ReadLine());
  13. int minionsCount = int.Parse(Console.ReadLine());
  14. int trucksCount = int.Parse(Console.ReadLine());
  15.  
  16. int ToysCount = puzzelsCount + dollsCount + TeddyBearsCount + minionsCount + trucksCount;
  17. double TotalPrice = (puzzelsCount * 2.60) + (dollsCount * 3) + (TeddyBearsCount * 4.10) + (minionsCount * 8.20) + (trucksCount * 2);
  18.  
  19. if(ToysCount >= 50)
  20. {
  21. TotalPrice *= 0.75;
  22. }
  23. TotalPrice *= 0.90;
  24.  
  25. if(TotalPrice > priceForTrip)
  26. {
  27. double moneyLeft = TotalPrice - priceForTrip;
  28. Console.WriteLine($"Yes! {moneyLeft:f2} lv left. ");
  29. }
  30.  
  31. else
  32. {
  33. double money = priceForTrip - TotalPrice;
  34. Console.WriteLine($"Not enough money! {money:f2} lv needed.");
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement