Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace IfElse
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double vacationPrice = double.Parse(Console.ReadLine());
  10. double puzzles = double.Parse(Console.ReadLine());
  11. double dolls = double.Parse(Console.ReadLine());
  12. double teddies = double.Parse(Console.ReadLine());
  13. double minions = double.Parse(Console.ReadLine());
  14. double trucks = double.Parse(Console.ReadLine());
  15.  
  16. double totalProfit = puzzles * 2.60 + dolls * 3 + teddies * 4.10 + minions * 8.20 + trucks * 2;
  17.  
  18. double toysNumber = puzzles + dolls + teddies + minions + trucks;
  19.  
  20. if (toysNumber >=50)
  21. {
  22. totalProfit = totalProfit - (totalProfit * 0.25);
  23. }
  24.  
  25. totalProfit = totalProfit - (totalProfit * 0.10);
  26.  
  27. if (totalProfit >= vacationPrice)
  28. {
  29. Console.WriteLine($"Yes! {totalProfit-vacationPrice:F2} lv left.");
  30. }
  31.  
  32. else
  33. {
  34. Console.WriteLine($"Not enough money! {vacationPrice-totalProfit:f2} lv needed.");
  35. }
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement