Anzzhhela98

df

Jul 16th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.16 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Mobile_operator
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string term = Console.ReadLine();
  10.             string typeContract = Console.ReadLine();
  11.             string internet = Console.ReadLine();
  12.             double countMounth = double.Parse(Console.ReadLine());
  13.             double tax = 0;
  14.          
  15.             if (term=="one")
  16.             {
  17.                 if (typeContract=="Small")
  18.                 {
  19.                     tax = 9.98;
  20.                 }
  21.                 else if (typeContract == "Middle")
  22.                 {
  23.                     tax = 18.99;
  24.                 }
  25.                 else if (typeContract == "Large")
  26.                 {
  27.                     tax = 25.98;
  28.                 }
  29.                 else if (typeContract == "ExtraLarge")
  30.                 {
  31.                     tax = 35.99;
  32.                 }
  33.             }
  34.             if (term == "two")
  35.             {
  36.                 if (typeContract == "Small")
  37.                 {
  38.                     tax = 8.58;
  39.                 }
  40.                 else if (typeContract == "Middle")
  41.                 {
  42.                     tax = 17.09;
  43.                 }
  44.                 else if (typeContract == "Large")
  45.                 {
  46.                     tax = 23.58;
  47.                 }
  48.                 else if (typeContract == "ExtraLarge")
  49.                 {
  50.                     tax = 31.79;
  51.                 }
  52.             }
  53.             if (internet=="yes")
  54.             {
  55.                 if (tax<=10)
  56.                 {
  57.                     tax = tax + 5.50;
  58.                 }
  59.                 else if (tax<=30)
  60.                 {
  61.                     tax = tax + 4.35;
  62.                 }
  63.                 else if (tax>30)
  64.                 {
  65.                     tax = tax + 3.85;
  66.                 }
  67.             }
  68.             double price = (countMounth * tax);
  69.             double discount = 0;
  70.             if (term=="two")
  71.             {
  72.                 discount= price * 0.0375;
  73.                 price = price - discount;
  74.                
  75.             }
  76.  
  77.             Console.WriteLine($"{price:f2} lv.");
  78.  
  79.  
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment