Advertisement
Niicksana

Mobile operator

Dec 9th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.57 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.             // Exam - 17 September 2017
  14.             string period = Console.ReadLine().ToLower();
  15.             string type = Console.ReadLine().ToLower();
  16.             string yesNo = Console.ReadLine().ToLower();
  17.             int months = int.Parse(Console.ReadLine());
  18.  
  19.             double monthly = 0;
  20.  
  21.             if (period == "one")
  22.             {
  23.                 if (type == "small")
  24.                 {
  25.                     if (yesNo == "yes")
  26.                     {
  27.                         monthly += 9.98 + 5.50;
  28.                     }
  29.  
  30.                     else
  31.                     {
  32.                         monthly += 9.98;
  33.                     }
  34.                 }
  35.  
  36.                 else if (type == "middle")
  37.                 {
  38.                     if (yesNo == "yes")
  39.                     {
  40.                         monthly += 18.99 + 4.35;
  41.                     }
  42.  
  43.                     else
  44.                     {
  45.                         monthly += 18.99;
  46.                     }
  47.                 }
  48.  
  49.                 else if (type == "large")
  50.                 {
  51.                     if (yesNo == "yes")
  52.                     {
  53.                         monthly += 25.98 + 4.35;
  54.                     }
  55.  
  56.                     else
  57.                     {
  58.                         monthly += 25.98;
  59.                     }
  60.                 }
  61.  
  62.                 else if (type == "extralarge")
  63.                 {
  64.                     if (yesNo == "yes")
  65.                     {
  66.                         monthly += 35.99 + 3.85;
  67.                     }
  68.  
  69.                     else
  70.                     {
  71.                         monthly += 35.99;
  72.                     }
  73.                 }
  74.             }
  75.  
  76.             else
  77.             {
  78.                 if (type == "small")
  79.                 {
  80.                     if (yesNo == "yes")
  81.                     {
  82.                         monthly += (8.58 + 5.50) - ((8.58 + 5.50) * 0.0375);
  83.                     }
  84.  
  85.                     else
  86.                     {
  87.                         monthly += 8.58 - (8.58 * 0.0375);
  88.                     }
  89.                 }
  90.  
  91.                 else if (type == "middle")
  92.                 {
  93.                     if (yesNo == "yes")
  94.                     {
  95.                         monthly += (17.09 + 4.35) - ((17.09 + 4.35) * 0.0375);
  96.                     }
  97.  
  98.                     else
  99.                     {
  100.                         monthly += 17.09 - (17.09 * 0.0375);
  101.                     }
  102.                 }
  103.  
  104.                 else if (type == "large")
  105.                 {
  106.                     if (yesNo == "yes")
  107.                     {
  108.                         monthly += (23.59 + 4.35) - ((23.59 + 4.35) * 0.0375);
  109.                     }
  110.  
  111.                     else
  112.                     {
  113.                         monthly += 23.59 - (23.59 * 0.0375);
  114.                     }
  115.                 }
  116.  
  117.                 else if (type == "extralarge")
  118.                 {
  119.                     if (yesNo == "yes")
  120.                     {
  121.                         monthly += (31.79 + 3.85) - ((31.79 + 3.85) * 0.0375);
  122.                     }
  123.  
  124.                     else
  125.                     {
  126.                         monthly += 31.79 - (31.79 * 0.0375);
  127.                     }
  128.                 }
  129.             }
  130.  
  131.             double price = monthly * months;
  132.             Console.WriteLine("{0:f2} lv.", price);
  133.         }
  134.     }
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement