Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Vacation
- {
- class Vacation
- {
- static void Main(string[] args)
- {
- int adults = int.Parse(Console.ReadLine());
- int childrens = int.Parse(Console.ReadLine());
- int nights = int.Parse(Console.ReadLine());
- var transport = (Console.ReadLine()).ToLower();
- double amountNights = (nights * 82.99);
- double amountAdults = 0;
- double amountChildrens = 0;
- double groupQTY = adults + childrens;
- if (transport == "train")
- {
- if (groupQTY >= 50)
- {
- amountAdults = adults * 24.99 * 0.5;
- amountChildrens = childrens * 14.99 * 0.5;
- }
- else
- {
- amountAdults = adults * 24.99;
- amountChildrens = childrens * 14.99;
- }
- }
- else if (transport == "bus")
- {
- amountAdults = adults * 32.5;
- amountChildrens = childrens * 28.5;
- }
- else if (transport == "boat")
- {
- amountAdults = adults * 42.99;
- amountChildrens = childrens * 39.99;
- }
- else if (transport == "airplane")
- {
- amountAdults = adults * 70;
- amountChildrens = childrens * 50;
- }
- amountAdults *= 2;
- amountChildrens *= 2;
- Console.WriteLine("{0:F2}", (amountNights+amountAdults+amountChildrens)*1.1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement