Facebook
From Bitty Monkey, 1 Year ago, written in Plain Text.
This paste is a reply to Untitled from Beige Owl - view diff
Embed
Download Paste or View Raw
Hits: 153
  1. Console.Write("What is your name: ");
  2. string name =Console.ReadLine();
  3. //imeto se zapisva za da moje po lesno da se razbere za kogo se govori vas ili klientite
  4.  
  5. Console.Write("How much does your vacation cost: ");
  6. int vacationPrice = Convert.ToInt32(Console.ReadLine());
  7.  
  8. if(vacationPrice>=0)
  9. {
  10. Console.WriteLine($"n{name} you have to open a shop so you can have money for the vacation.n");
  11. Console.WriteLine("Welcome to the new shop of ITPG high school.n ---Here are the prices---");
  12.  
  13. Console.WriteLine("   puzzle = 2.60  lv");
  14. Console.WriteLine("   talking doll = 3.00 lv");
  15. Console.WriteLine("   teddy bear = 4.10 lv");
  16. Console.WriteLine("   minion = 8.20 lv");
  17. Console.WriteLine("   toy car = 2.00 lv");
  18.  
  19.  
  20. Console.Write("how many Puzzles do you want: ");
  21. int orderPuzzel = Convert.ToInt32(Console.ReadLine());
  22.  
  23. Console.Write("how many Dolls do you want: ");
  24. int orderDoll = Convert.ToInt32(Console.ReadLine());
  25.  
  26. Console.Write("how many Teddy bears do you want: ");
  27. int orderBear = Convert.ToInt32(Console.ReadLine());
  28.  
  29. Console.Write("how many Minions do you want: ");
  30. int orderMInion = Convert.ToInt32(Console.ReadLine());
  31.  
  32. Console.Write("how many Car toys do you want: ");
  33. int orderCar = Convert.ToInt32(Console.ReadLine());
  34.  
  35.  
  36. double totalPrice = (orderPuzzel*2.6 + orderDoll*3 + orderBear*4.1 + orderMInion*8.2 + orderCar*2);
  37.  
  38. if (orderPuzzel + orderDoll+ orderBear + orderMInion + orderCar >= 50)
  39. {
  40.     double discount = (totalPrice)*0.25;
  41.    
  42.     Console.WriteLine($"Because your order is over 50 here is a discount of 25%nWhich is Equal to {Math.Round(discount, 2)} lv");
  43.     Console.WriteLine($"your total comes up to:{Math.Round(totalPrice-discount,2)} lv.");
  44.  
  45.    if (vacationPrice < (totalPrice-discount)*0.10)
  46.   {
  47.   Console.WriteLine($"{name} you've exeeded the price of the vacation so you have {Math.Round(totalPrice*0.10-vacationPrice),2} lv left");
  48.   }
  49.  
  50.   else if( vacationPrice > (totalPrice-discount)*0.10)
  51.   {
  52.    Console.WriteLine($"{name} you have to safe {Math.Round(vacationPrice-(totalPrice-discount)*0.10)} lv more.");
  53.   }
  54.  
  55.   else
  56.   {
  57.     Console.WriteLine($" {name} you have the exact amount of money for the vacation");
  58.   }
  59.  
  60. }
  61.  
  62. else
  63. {
  64.     Console.WriteLine("You don't have a discount.");
  65.     if (vacationPrice < totalPrice*0.1)
  66.  {
  67.   Console.WriteLine($" {name} you've exeeded the price of the vacation so you have {Math.Round(totalPrice*0.1-vacationPrice),2} lv left");
  68.  }
  69.  
  70.   else if( vacationPrice > totalPrice*0.1)
  71.   {
  72.     System.Console.WriteLine($"{name} you have to safe {Math.Round(vacationPrice-totalPrice*0.1)} lv more.");
  73.   }
  74.  
  75.   else
  76.   {
  77.    Console.WriteLine($"{name} you have the exact amount of money for the vacation");
  78.   }
  79.  
  80. }
  81.  
  82. }
  83.  
  84. else
  85. {
  86.     System.Console.WriteLine("The vacation can't be negative value.");
  87. }
  88.  
  89. Console.ReadKey();
  90.  
  91.