Advertisement
optybg

Transport_Price

Sep 14th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Transport_Price
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var kmInput = double.Parse(Console.ReadLine());
  14.             var DayNight = Console.ReadLine();
  15.             double CheapTravel = 0.0;
  16.  
  17.             if (kmInput > 100)
  18.             {
  19.                 CheapTravel = kmInput * 0.06;
  20.                 Console.WriteLine(String.Format("{0:0.##}", CheapTravel));
  21.             }
  22.             else if (kmInput > 20)
  23.             {
  24.                 CheapTravel = kmInput * 0.09;
  25.                 Console.WriteLine(String.Format("{0:0.##}", CheapTravel));
  26.             }
  27.             else
  28.             {
  29.                 if (DayNight == "day")
  30.                 {
  31.                     CheapTravel = 0.70 + kmInput * 0.79;
  32.                 }
  33.                 else
  34.                 {
  35.                     CheapTravel = 0.70 + kmInput * 0.90;
  36.                 }
  37.  
  38.                 Console.WriteLine(String.Format("{0:0.##}",CheapTravel));
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement