Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 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 Cena_na_transport
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var km = int.Parse(Console.ReadLine());
  14.             string time = Console.ReadLine();
  15.             var dkmTaxi =  0.79;
  16.             var nkmTaxi = 0.90;
  17.             var tarifTaxi = 0.70;
  18.            
  19.          
  20.             var price = 0.0;
  21.             if (km <20)
  22.             {
  23.                 if(time=="day")
  24.                 {
  25.                     price = (km * dkmTaxi) + tarifTaxi;
  26.                 }
  27.                 else if (time=="night")
  28.                 {
  29.                      price = (km * nkmTaxi) + tarifTaxi;
  30.                 }
  31.             }
  32.            
  33.             if (km >20 && km<100)
  34.             {
  35.                 price = km * 0.09;
  36.             }
  37.             else if(km>100)
  38.             {
  39.                 price = km * 0.06;
  40.             }
  41.             {
  42.                 Console.WriteLine(price);
  43.             }
  44.  
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement