Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var car_model = Console.ReadLine();
- var car_type = Console.ReadLine();
- var season = Console.ReadLine();
- var condition = Console.ReadLine();
- var price = double.Parse(Console.ReadLine());
- var exp_profit = double.Parse(Console.ReadLine());
- double profit = 0;
- if (condition.ToLower()=="perfect")
- {
- if (car_type.ToLower() == "suv")
- {
- profit = price * (0.3);
- }
- else if (car_type.ToLower() == "sedan")
- {
- profit = price * (0.25);
- }
- }
- else if (condition.ToLower() == "goood")
- {
- if (car_type.ToLower() == "suv")
- {
- profit = price * (0.2);
- }
- else if (car_type.ToLower() == "sedan")
- {
- profit = price * (0.15);
- }
- }
- else if (condition.ToLower() == "bad") {
- if (car_type.ToLower() == "suv")
- {
- profit = price * (0.1);
- }
- else if (car_type.ToLower() == "sedan")
- {
- profit = price * (0.1);
- }
- }
- if (season.ToLower() == "winter")
- {
- profit = profit - 200;
- }
- if (profit > exp_profit)
- {
- Console.WriteLine("The profit on {0} will be good – {1} BGN", car_model, profit);
- }
- else {
- double need = exp_profit - profit;
- Console.WriteLine("The car is not worth selling now");
- Console.WriteLine(String.Format("Need {0:00} more profit", need));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement