Advertisement
ad2bg

MobileOperator

Dec 5th, 2017
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. namespace MobileOperator
  2. {
  3.     using System;
  4.  
  5.     class MobileOperator
  6.     {
  7.         static void Main()
  8.         {
  9.             string term = Console.ReadLine().ToLower();
  10.             string type = Console.ReadLine().ToLower();
  11.             string internet = Console.ReadLine().ToLower();
  12.             int n = int.Parse(Console.ReadLine());
  13.  
  14.             double monthlyFee = 0;
  15.  
  16.             if (term == "one")
  17.             {
  18.                 if (type == "small") { monthlyFee = 9.98; }
  19.                 if (type == "middle") { monthlyFee = 18.99; }
  20.                 if (type == "large") { monthlyFee = 25.98; }
  21.                 if (type == "extralarge") { monthlyFee = 35.99; }
  22.             }
  23.             else
  24.             {
  25.                 if (type == "small") { monthlyFee = 8.58; }
  26.                 if (type == "middle") { monthlyFee = 17.09; }
  27.                 if (type == "large") { monthlyFee = 23.59; }
  28.                 if (type == "extralarge") { monthlyFee = 31.79; }
  29.             }
  30.  
  31.             if (internet == "yes")
  32.             {
  33.                 monthlyFee +=
  34.                     monthlyFee <= 10 ? 5.50 :
  35.                     monthlyFee <= 30 ? 4.35 :
  36.                     3.85;
  37.             }
  38.  
  39.             if (term == "two") { monthlyFee *= (1 - 0.0375); }
  40.  
  41.             Console.WriteLine($"{monthlyFee * n:F2} lv.");
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement