Advertisement
Guest User

Untitled

a guest
May 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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 _12PeyToyShopMe
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double tripPrice = double.Parse(Console.ReadLine());
  14. int puzzels = int.Parse(Console.ReadLine());
  15. int talkingDolls = int.Parse(Console.ReadLine());
  16. int teddybears = int.Parse(Console.ReadLine());
  17. int minions = int.Parse(Console.ReadLine());
  18. int trucks = int.Parse(Console.ReadLine());
  19.  
  20. double totalSum = puzzels * 2.60 + talkingDolls * 3.0 + teddybears * 4.10 + minions * 8.20 + trucks * 2.0;
  21. double toysCount = puzzels + talkingDolls + teddybears + minions + trucks;
  22. double discount = totalSum * 0.25;
  23. discount = totalSum - discount;
  24.  
  25.  
  26. if (toysCount > 50)
  27. {
  28.  
  29. discount = totalSum - discount;
  30. }
  31. else if (toysCount < 50)
  32. {
  33. discount = 0;
  34. }
  35.  
  36.  
  37. double endPrice = totalSum - discount;
  38. double rent = endPrice * 0.1;
  39. double earning = endPrice - rent;
  40.  
  41. if (earning > tripPrice)
  42. {
  43. double leftmoney = earning - tripPrice;
  44. Console.WriteLine("Yes! {0:f2} lv left.", leftmoney);
  45. }
  46. else if (earning < tripPrice)
  47. {
  48.  
  49. double moneyneeded = tripPrice - earning;
  50. Console.WriteLine("Not enough money! {0:f2} lv needed.", moneyneeded);
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement