Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TransportPrice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int distance = int.Parse(Console.ReadLine());
- String timeOfDay = Console.ReadLine();
- if (distance >= 100)
- {
- double price = distance * 0.06;
- Console.WriteLine("{0:F2}", price);
- }
- else if (distance >= 20)
- {
- double price = distance * 0.09;
- Console.WriteLine("{0:F2}", price);
- }
- else
- {
- double price = 0.70;
- if (timeOfDay == "day")
- {
- price += distance * 0.79;
- }
- else if (timeOfDay == "night")
- {
- price += distance * 0.90;
- }
- Console.WriteLine("{0:F2}", price);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement