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 demo2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double kilometers = double.Parse(Console.ReadLine());
- string shift = Console.ReadLine().ToLower();
- double price = 0;
- if (kilometers >= 100)
- {
- price = kilometers * 0.06;
- Console.WriteLine(price);
- }
- else if (kilometers >= 20)
- {
- price = kilometers * 0.09;
- Console.WriteLine(price);
- }
- else if (kilometers < 20)
- {
- if (shift == "day")
- {
- price = (kilometers * 0.79) + 0.70;
- }
- else
- {
- price = (kilometers * 0.90) + 0.70;
- }
- Console.WriteLine(price);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment