Advertisement
grach

2017_18_March_Car To Go

Jul 20th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 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 CarToGo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double budget = double.Parse(Console.ReadLine());
  14.             string season = Console.ReadLine();
  15.  
  16.             if (budget > 500) //кода се изпълнява с предимство за богатите
  17.             {
  18.                 var jeep = budget * 0.90;
  19.                 Console.WriteLine("Luxury class");
  20.                 Console.WriteLine("Jeep - {0:f2}", jeep);
  21.             }
  22.  
  23.             else if (season == "Summer")
  24.             {
  25.                 if (budget > 100 && budget <= 500)
  26.                 {
  27.                     Console.WriteLine("Compact class");
  28.                     Console.WriteLine($"Cabrio - {budget * 0.45:f2}");
  29.                 }
  30.  
  31.                 if (budget < 100)
  32.                 {
  33.                     Console.WriteLine("Economy class");
  34.                     Console.WriteLine($"Cabrio - {budget * 0.35:f2}");
  35.                 }
  36.             }
  37.  
  38.             else if (season == "Winter")
  39.             {
  40.                 if (budget > 100 && budget <= 500)
  41.                 {
  42.                     Console.WriteLine("Compact class");
  43.                     Console.WriteLine($"Jeep - {budget * 0.80:f2}");
  44.                 }
  45.  
  46.                 if (budget < 100)
  47.                 {
  48.                     Console.WriteLine("Economy class");
  49.                     Console.WriteLine($"Jeep - {budget * 0.65:f2}");
  50.                 }
  51.  
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement