Advertisement
Guest User

Untitled

a guest
Jan 9th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         string dayOrNight = Console.ReadLine();
  9.  
  10.         double transportPrice = 0d;
  11.  
  12.         if (n >= 100)
  13.         {
  14.             transportPrice = n * 0.06;
  15.         }
  16.         else if (n >= 20 && n < 100)
  17.         {
  18.             transportPrice = n * 0.9;
  19.         }
  20.         else
  21.         {
  22.             switch (dayOrNight)
  23.             {
  24.                 case "day":
  25.                     transportPrice = 0.7 + n * 0.79; break;
  26.                 case "night":
  27.                     transportPrice = 0.7 + n * 0.90; break;
  28.             }
  29.         }
  30.         Console.WriteLine("{0:f2}", transportPrice);
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement