Advertisement
Guest User

Untitled

a guest
Jun 10th, 2020
70
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 ToyStore
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double tripExpenses = double.Parse(Console.ReadLine());
  10. double puzzle = double.Parse(Console.ReadLine());
  11. double dolls = double.Parse(Console.ReadLine());
  12. double bears = double.Parse(Console.ReadLine());
  13. double minion = double.Parse(Console.ReadLine());
  14. double truck = double.Parse(Console.ReadLine());
  15.  
  16. double sum = puzzle * 2.60 + dolls * 3 + bears * 4.10 + minion * 8.20 + truck * 2;
  17. double toyNumber = puzzle + dolls + bears + minion + truck;
  18. //double discount = sum * 0.25;
  19. //double totalSum = sum - discount;
  20. //double rent = totalSum * 0.1;
  21. //double profit = totalSum - rent;
  22. sum *= 0.90;
  23.  
  24. if (toyNumber > 50)
  25. {
  26. sum *= 0.75;
  27. }
  28. if (sum >= tripExpenses)
  29. {
  30. sum -= tripExpenses;
  31. Console.WriteLine($" Yes! {sum:f2} lv left.");
  32. }
  33. else if (sum <= tripExpenses)
  34. {
  35. double sum1 = tripExpenses - sum;
  36. Console.WriteLine($"Not enough money! {sum1:f2} lv needed.");
  37. }
  38.  
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement