Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Transport_Price
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string dayOrNight = Console.ReadLine().ToString();
- double taxi = 0.70;
- double bus = 0.09;
- double train = 0.06;
- double taxiday = 0.79;
- double taxiNight = 0.90;
- if (n <= 20 && dayOrNight == "day") // taxi
- {
- Console.WriteLine($"{taxi + (n * taxiday):f2}");
- }
- else if (n <= 20 && dayOrNight == "night")
- {
- Console.WriteLine($"{((n * taxiNight) + taxi):f2}");
- }
- else if (n >= 20 && dayOrNight == "day")
- {
- Console.WriteLine($"{(n * bus):f2}");
- }
- else if (n >= 100)
- {
- Console.WriteLine($"{(n * train):f2}");
- }
- else
- {
- Console.WriteLine("Invalid");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement