Advertisement
j0nze

Mobile Operator

Nov 4th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 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 _3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string contractLength = Console.ReadLine();
  14.             string contractType = Console.ReadLine();
  15.             string addonInet = Console.ReadLine();
  16.             int months = int.Parse(Console.ReadLine());
  17.  
  18.             double price = 0;
  19.  
  20.             if (contractLength == "one")
  21.             {
  22.                 switch (contractType)
  23.                 {
  24.                     case "Small": price = 9.98; break;
  25.                     case "Middle": price = 18.99; break;
  26.                     case "Large": price = 25.98; break;
  27.                     case "ExtraLarge": price = 35.99; break;
  28.                 }
  29.             }
  30.             else
  31.             {
  32.                 switch (contractType)
  33.                 {
  34.                     case "Small": price = 8.58; break;
  35.                     case "Middle": price = 17.09; break;
  36.                     case "Large": price = 23.59; break;
  37.                     case "ExtraLarge": price = 31.79; break;
  38.                 }
  39.             }
  40.  
  41.             if (addonInet == "yes")
  42.             {
  43.                 if (price <= 10)
  44.                 {
  45.                     price += 5.50;
  46.                 }
  47.                 else if (price > 10 && price <= 30)
  48.                 {
  49.                     price += 4.35;
  50.                 }
  51.                 else if (price > 30)
  52.                 {
  53.                     price += 3.85;
  54.                 }              
  55.             }
  56.             price *= months;
  57.             if (contractLength == "two")
  58.             {
  59.                 price -= price * 0.0375;
  60.             }
  61.             Console.WriteLine("{0:F2} lv.", price);
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement