Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 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 Magazin_za_detski_igrachki
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. //Toy prices
  14. double puzzle = 2.60;
  15. double doll = 3;
  16. double teddybear = 4.10;
  17. double minion = 8.20;
  18. double truck = 2;
  19.  
  20. //Input (6)
  21. double TourPrice = double.Parse(Console.ReadLine());
  22. int puzzleQ= int.Parse(Console.ReadLine());
  23. int dollQ = int.Parse(Console.ReadLine());
  24. int teddybearQ = int.Parse(Console.ReadLine());
  25. int minionQ = int.Parse(Console.ReadLine());
  26. int truckQ = int.Parse(Console.ReadLine());
  27.  
  28. //Total amount of orders
  29. int orders = (puzzleQ+dollQ+teddybearQ+minionQ+truckQ);
  30.  
  31. //Single order price
  32. double puzzleP = (puzzle*puzzleQ);
  33. double dollP = (doll*dollQ);
  34. double teddybearP = (teddybear * teddybearQ);
  35. double minionP = (minion * minionQ);
  36. double truckP = (truck * truckQ);
  37.  
  38. //Total order price
  39. double totalprice = Math.Abs(puzzleP + dollP + teddybearP + minionP + truckP);
  40.  
  41. //Discount
  42. double discount = 0;
  43. if (orders >= 50) { discount = Math.Abs(0.25 * totalprice); }
  44.  
  45. //End price/winnings
  46. double endprice = Math.Abs(totalprice - discount);
  47.  
  48. //Rent
  49. double rent = Math.Abs(0.10 * endprice);
  50.  
  51. //endendprice
  52. double endendprice = Math.Abs(endprice - rent);
  53.  
  54. //
  55. if (TourPrice<=endendprice)
  56. {
  57. Console.WriteLine("Yes! {0:F} lv left."
  58. , Math.Abs(endendprice -TourPrice));
  59. }
  60. else
  61. {
  62. Console.WriteLine("Not enough money! {0:F} lv needed."
  63. , Math.Abs(TourPrice -endendprice));
  64. }
  65.  
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement