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 (string.Equals(condition, "perfect", StringComparison.CurrentCultureIgnoreCase))
- {
- if (string.Equals(car_type, "SUV", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.3);
- }
- else if (string.Equals(car_type, "Sedan", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.25);
- }
- }
- else if (string.Equals(condition, "good", StringComparison.CurrentCultureIgnoreCase))
- {
- if (string.Equals(car_type, "SUV", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.2);
- }
- else if (string.Equals(car_type, "Sedan", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.15);
- }
- }
- else if (string.Equals(condition, "bad", StringComparison.CurrentCultureIgnoreCase)) {
- if (string.Equals(car_type, "SUV", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.1);
- }
- else if (string.Equals(car_type, "Sedan", StringComparison.CurrentCultureIgnoreCase))
- {
- profit = price * (0.1);
- }
- }
- if (string.Equals(season, "winter", StringComparison.CurrentCultureIgnoreCase)) {
- 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("Need {0} more profit", need);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement