Advertisement
kalin729

втора

Dec 17th, 2017 (edited)
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. var car_model = Console.ReadLine();
  2.         var vin = int.Parse(Console.ReadLine());
  3.         var condition = Console.ReadLine();
  4.         var price = int.Parse(Console.ReadLine());
  5.         bool accept = false;
  6.        
  7.         var profit = price*(0.15);
  8.        
  9.         if(condition == "good"){
  10.             accept = true;
  11.         } else {
  12.             accept = false;
  13.         }
  14.        
  15.         if(vin<90000 && accept == true){
  16.             accept = true;
  17.         } else {
  18.             accept = false;
  19.         }
  20.        
  21.         if(profit > 400 && accept == true){
  22.             accept = true;
  23.         } else {
  24.             accept = false;
  25.         }
  26.        
  27.         if(accept == true){
  28.             Console.WriteLine("yes - {0}", car_model);
  29.         } else {
  30.             Console.WriteLine("no");
  31.             if(condition != "good"){
  32.             Console.WriteLine("The car is in bad condition");
  33.             }
  34.             if(vin>90000){
  35.             Console.WriteLine("VIN {0} is not valid", vin);
  36.             }
  37.             if(profit < 400){
  38.             Console.WriteLine("Cannot make discount, profit too low – {0}, profit");
  39.             }
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement