Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CarToGoOptimize
- {
- class CarToGoOptimize
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine().ToLower();
- string classType = string.Empty;
- double prize = 0;
- string carType = string.Empty;
- if (budget <= 100)
- {
- if (season == "summer" || season == "winter")
- {
- classType = "Economy class";
- if (season == "summer")
- {
- carType = "Cabrio";
- prize += budget * 0.35;
- }
- else
- {
- carType = "Jeep";
- prize += budget * 0.65;
- }
- }
- }
- else if (budget > 100 && budget <= 500)
- {
- classType = "Compact class";
- if (season == "summer")
- {
- carType = "Cabrio";
- prize += budget * 0.45;
- }
- else
- {
- carType = "Jeep";
- prize += budget * 0.80;
- }
- }
- else
- {
- classType = "Luxury class";
- carType = "Jeep";
- prize += budget * 0.90;
- }
- Console.WriteLine($"{classType}");
- Console.WriteLine($"{carType} - {prize:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement