Advertisement
IvanBorisovG

CarToGo

Oct 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.95 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 CarToGo
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double budget = double.Parse(Console.ReadLine());
  14.             string season = Console.ReadLine().ToLower();
  15.             string classType = string.Empty;
  16.             double prize = 0;
  17.             string carType = string.Empty;
  18.             if (season == "summer")
  19.             {
  20.                 if (budget <= 100)
  21.                 {
  22.                     classType = "Economy class";
  23.                     carType = "Cabrio";
  24.                     prize += budget * 0.35;
  25.                 }
  26.                 else if (budget > 100 && budget <= 500)
  27.                 {
  28.                     classType = "Compact class";
  29.                     carType = "Cabrio";
  30.                     prize += budget * 0.45;
  31.                 }
  32.                 else
  33.                 {
  34.                     classType = "Luxury class";
  35.                     carType = "Jeep";
  36.                     prize += budget * 0.90;
  37.                 }
  38.                
  39.             }
  40.             else
  41.             {
  42.                 if (budget <= 100)
  43.                 {
  44.                     classType = "Economy class";
  45.                     carType = "Jeep";
  46.                     prize += budget * 0.65;
  47.                 }
  48.                 else if (budget > 100 && budget <= 500)
  49.                 {
  50.                     classType = "Compact class";
  51.                     carType = "Jeep";
  52.                     prize += budget * 0.80;
  53.                 }
  54.                 else
  55.                 {
  56.                     classType = "Luxury class";
  57.                     carType = "Jeep";
  58.                     prize += budget * 0.90;
  59.                 }
  60.             }
  61.             Console.WriteLine($"{classType}");
  62.             Console.WriteLine($"{carType} - {prize:f2}");        
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement