Advertisement
kalin729

трета 2

Dec 17th, 2017 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.88 KB | None | 0 0
  1. var car_model = Console.ReadLine();
  2.             var car_type = Console.ReadLine();
  3.             var season = Console.ReadLine();
  4.             var condition = Console.ReadLine();
  5.             var price = double.Parse(Console.ReadLine());
  6.             var exp_profit = double.Parse(Console.ReadLine());
  7.             double profit = 0;
  8.  
  9.             if (condition.ToLower()=="perfect")
  10.             {
  11.                 if (car_type.ToLower() == "suv")
  12.                 {
  13.                     profit = price * (0.3);
  14.                 }
  15.                 else if (car_type.ToLower() == "sedan")
  16.                 {
  17.                     profit = price * (0.25);
  18.                 }
  19.             }
  20.             else if (condition.ToLower() == "goood")
  21.             {
  22.                 if (car_type.ToLower() == "suv")
  23.                 {
  24.                     profit = price * (0.2);
  25.                 }
  26.                 else if (car_type.ToLower() == "sedan")
  27.                 {
  28.                     profit = price * (0.15);
  29.                 }
  30.             }
  31.             else if (condition.ToLower() == "bad") {
  32.                 if (car_type.ToLower() == "suv")
  33.                 {
  34.                     profit = price * (0.1);
  35.                 }
  36.                 else if (car_type.ToLower() == "sedan")
  37.                 {
  38.                     profit = price * (0.1);
  39.                 }
  40.             }
  41.  
  42.             if (season.ToLower() == "winter")
  43.             {
  44.                 profit = profit - 200;
  45.             }
  46.  
  47.             if (profit > exp_profit)
  48.             {
  49.                 Console.WriteLine("The profit on {0} will be good – {1} BGN", car_model, profit);
  50.             }
  51.             else {
  52.                 double need = exp_profit - profit;
  53.                 Console.WriteLine("The car is not worth selling now");
  54.                 Console.WriteLine(String.Format("Need {0:00} more profit", need));
  55.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement