Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CarToGo
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string car = "";
- string classs = "";
- if (budget > 500)
- {
- car = "Jeep";
- classs = "Luxury class";
- budget = 0.9 * budget;
- }
- else if (budget > 100 && budget <= 500)
- {
- if (season == "Summer")
- {
- car = "Cabrio";
- budget = 0.45 * budget;
- }
- else
- {
- car = "Jeep";
- budget = 0.8 * budget;
- }
- classs = "Compact class";
- }
- else if (budget > 0 && budget <= 100)
- {
- if (season == "Summer")
- {
- car = "Cabrio";
- budget = 0.35 * budget;
- }
- else
- {
- car = "Jeep";
- budget = 0.65 * budget;
- }
- classs = "Economy class";
- }
- Console.WriteLine(classs);
- Console.WriteLine($"{car} - {budget:F2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment