Advertisement
IvanBorisovG

CarToGoo

Oct 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.77 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 CarToGoOptimize
  8. {
  9.     class CarToGoOptimize
  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.  
  19.             if (budget <= 100)
  20.             {
  21.                 if (season == "summer" || season == "winter")
  22.                 {
  23.                     classType = "Economy class";
  24.                     if (season == "summer")
  25.                     {
  26.                         carType = "Cabrio";
  27.                         prize += budget * 0.35;
  28.                     }
  29.                     else
  30.                     {
  31.                         carType = "Jeep";
  32.                         prize += budget * 0.65;
  33.                     }
  34.                 }                          
  35.             }
  36.             else if (budget > 100 && budget <= 500)
  37.             {
  38.                 classType = "Compact class";
  39.                 if (season == "summer")
  40.                 {
  41.                     carType = "Cabrio";
  42.                     prize += budget * 0.45;
  43.                 }
  44.                 else
  45.                 {
  46.                     carType = "Jeep";
  47.                     prize += budget * 0.80;
  48.                 }
  49.             }
  50.             else
  51.             {
  52.                 classType = "Luxury class";
  53.                 carType = "Jeep";
  54.                 prize += budget * 0.90;
  55.             }
  56.             Console.WriteLine($"{classType}");
  57.             Console.WriteLine($"{carType} - {prize:f2}");
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement