countDecko

toyShop

Sep 18th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 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 toy_shop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double priceOfHoliday = double.Parse(Console.ReadLine());
  14. int numberOfPuzzles = int.Parse(Console.ReadLine());
  15. int numberOfDolls = int.Parse(Console.ReadLine());
  16. int numberOfBears = int.Parse(Console.ReadLine());
  17. int numberOfMinions = int.Parse(Console.ReadLine());
  18. int numberOfTrucks = int.Parse(Console.ReadLine());
  19.  
  20. double moneyEarned = numberOfBears * 4.10 + numberOfDolls * 3 + numberOfMinions * 8.20 + numberOfPuzzles * 2.60
  21. + numberOfTrucks * 2;
  22.  
  23. if (numberOfBears + numberOfDolls + numberOfMinions + numberOfPuzzles + numberOfTrucks >= 50)
  24. {
  25. moneyEarned = moneyEarned - moneyEarned * 0.25;
  26. }
  27. moneyEarned = moneyEarned - moneyEarned * 0.10;
  28.  
  29. if (moneyEarned >= priceOfHoliday) Console.WriteLine($"Yes! {(moneyEarned - priceOfHoliday):F2} lv left.");
  30. else Console.WriteLine($"Not enough money! {(priceOfHoliday - moneyEarned):F2} lv needed.");
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment