Advertisement
drunin89

Vacation

Nov 24th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 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 Vacation
  8. {
  9.     class Vacation
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int adults = int.Parse(Console.ReadLine());
  14.             int childrens = int.Parse(Console.ReadLine());
  15.             int nights = int.Parse(Console.ReadLine());
  16.             var transport = (Console.ReadLine()).ToLower();
  17.             double amountNights = (nights * 82.99);
  18.             double amountAdults = 0;
  19.             double amountChildrens = 0;
  20.             double groupQTY = adults + childrens;
  21.             if (transport == "train")
  22.             {
  23.                 if (groupQTY >= 50)
  24.                 {
  25.                     amountAdults = adults * 24.99 * 0.5;
  26.                     amountChildrens = childrens * 14.99 * 0.5;
  27.                 }
  28.                 else
  29.                 {
  30.                     amountAdults = adults * 24.99;
  31.                     amountChildrens = childrens * 14.99;
  32.  
  33.                 }
  34.             }
  35.             else if (transport == "bus")
  36.             {
  37.                 amountAdults = adults * 32.5;
  38.                 amountChildrens = childrens * 28.5;
  39.             }
  40.             else if (transport == "boat")
  41.             {
  42.                 amountAdults = adults * 42.99;
  43.                 amountChildrens = childrens * 39.99;
  44.             }
  45.             else if (transport == "airplane")
  46.             {
  47.                 amountAdults = adults * 70;
  48.                 amountChildrens = childrens * 50;
  49.             }
  50.             amountAdults *= 2;
  51.             amountChildrens *= 2;
  52.  
  53.             Console.WriteLine("{0:F2}", (amountNights+amountAdults+amountChildrens)*1.1);
  54.  
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement