Guest User

Untitled

a guest
Aug 21st, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         double oldPeople = double.Parse(Console.ReadLine());
  7.         double students = double.Parse(Console.ReadLine());
  8.         double nights = double.Parse(Console.ReadLine());
  9.         string typetransport = Console.ReadLine();
  10.         double total = 0.00;
  11.  
  12.         if (typetransport == "train")
  13.         {
  14.             if (oldPeople + students >= 50)
  15.             {
  16.                 total = (oldPeople * 24.99 / 2 + students * 14.99 / 2) * 2.00 + nights * 82.99 ;
  17.             }
  18.             else
  19.             {
  20.                 total = (oldPeople * 24.99 + students * 14.99) * 2.00 + nights * 82.99;
  21.             }
  22.         }
  23.         else if (typetransport == "bus")
  24.         {
  25.             total = (oldPeople * 32.50 + students * 28.50) * 2.00 + nights * 82.99 ;
  26.         }
  27.         else if (typetransport == "boat")
  28.         {
  29.             total = (oldPeople * 42.99 + students * 39.99) * 2.00 + nights * 82.99 ;
  30.         }
  31.         else if (typetransport == "airplane")
  32.         {
  33.             total = (oldPeople * 70.00 + students * 50.00) * 2.00 + nights * 82.99 ;
  34.         }
  35.         Console.WriteLine("{0:f2}", total * 1.10);
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment