Guest User

Untitled

a guest
Dec 16th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.52 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 _03.Mobile_operator
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string contract = Console.ReadLine();
  14.             string typeContract = Console.ReadLine();
  15.             string internet = Console.ReadLine();
  16.             var month = int.Parse(Console.ReadLine());
  17.  
  18.             var sum = 0.0;
  19.  
  20.             if (contract == "one")
  21.             {
  22.                 if (typeContract == "Small")
  23.                 {
  24.                     sum = 9.98;
  25.                 }
  26.                 else if (typeContract == "Middle")
  27.                 {
  28.                     sum = 18.99;
  29.                 }
  30.                 else if (typeContract == "Large")
  31.                 {
  32.                     sum = 25.98;
  33.                 }
  34.                 else if (typeContract == "ExtraLarge")
  35.                 {
  36.                     sum = 35.99;
  37.                 }
  38.             }
  39.             else if (internet == "yes")
  40.             {
  41.                 if (sum <= 10)
  42.                 {
  43.                     sum += 5.50;
  44.                 }
  45.                 else if (sum >=10 && sum <= 30)
  46.                 {
  47.                     sum += 4.35;
  48.                 }
  49.                 else if (sum > 30)
  50.                 {
  51.                     sum += 3.85;
  52.                 }
  53.             }
  54.             else if (contract == "two")
  55.             {
  56.                 if (typeContract == "Small")
  57.                 {
  58.                     sum = 8.58;
  59.                 }
  60.                 else if (typeContract == "Middle")
  61.                 {
  62.                     sum = 17.09;
  63.                 }
  64.                 else if (typeContract == "Large")
  65.                 {
  66.                     sum = 23.59;
  67.                 }
  68.                 else if (typeContract == "ExtraLarge")
  69.                 {
  70.                     sum = 31.79;
  71.                 }
  72.             }
  73.             else if (internet == "yes")
  74.             {
  75.                 if (sum <= 10)
  76.                 {
  77.                     sum += 5.50;
  78.                 }
  79.                 else if (sum >= 10 && sum <= 30)
  80.                 {
  81.                     sum += 4.35;
  82.                 }
  83.                 else if (sum > 30)
  84.                 {
  85.                     sum += 3.85;
  86.  
  87.                 }
  88.                
  89.             }
  90.             sum *= 1 - 0.0375;
  91.  
  92.             var fullSum = sum * month;
  93.             Console.WriteLine("{0:f2} lv.",fullSum);
  94.         }
  95.     }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment