Advertisement
Sim0o0na

Untitled

Dec 17th, 2016
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 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 Project1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var siniors = int.Parse(Console.ReadLine());
  14.             var students = int.Parse(Console.ReadLine());
  15.             var nights = int.Parse(Console.ReadLine());
  16.             string transport = Console.ReadLine();
  17.  
  18.             var siniorTax = 0.00;
  19.             var studentsTax = 0.00;
  20.  
  21.             switch (transport)
  22.             {
  23.                 case "train":
  24.                     siniorTax = 24.99;
  25.                     studentsTax = 14.99;
  26.                     if (siniors + students >= 50)
  27.                     {
  28.                         siniorTax = 24.99 * 0.75;
  29.                         studentsTax =14.99 * 0.75;
  30.                     }
  31.                     else
  32.                     {
  33.                         siniorTax = 24.99;
  34.                         studentsTax = 14.99;
  35.                     }
  36.                     break;
  37.                 case "bus":
  38.                     siniorTax = 32.50;
  39.                     studentsTax = 28.50;
  40.                     break;
  41.                 case "ship":
  42.                     siniorTax = 42.99;
  43.                     studentsTax = 39.99;
  44.                     break;
  45.                 case "plane":
  46.                     siniorTax = 70.00;
  47.                     studentsTax = 50.00;
  48.                     break;
  49.             }
  50.             var transportRazhod = siniors * siniorTax + students * studentsTax;
  51.             var hotel = nights * 82.99;
  52.             var commisiona = (transportRazhod + hotel) * 0.10;
  53.             var summ = transportRazhod + hotel + commisiona;
  54.  
  55.             Console.WriteLine("{0:f2}", summ);
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement