Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TruckDriver
- {
- class Program
- {
- static void Main(string[] args)
- {
- string season = Console.ReadLine();
- double km = double.Parse(Console.ReadLine());
- double sum = 0;
- if (km > 0 && km <= 5000)
- {
- switch (season)
- {
- case "Spring":
- case "Autumn":
- sum = 0.75;
- break;
- case "Summer":
- sum = 0.9;
- break;
- case "Winter":
- sum = 1.05;
- break;
- }
- }
- else if (km > 5000 && km <= 10000)
- {
- switch (season)
- {
- case "Spring":
- case "Autumn":
- sum = 0.95;
- break;
- case "Summer":
- sum = 1.1;
- break;
- case "Winter":
- sum = 1.25;
- break;
- }
- }
- else if (km > 10000 && km <= 20000)
- {
- sum = 1.45;
- }
- Console.WriteLine($"{sum * km * 4 * 0.9:F2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment