Anonimka

Untitled

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