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 Program
- {
- static void Main(string[] args)
- {
- int adults = int.Parse(Console.ReadLine());
- int students = int.Parse(Console.ReadLine());
- int nights = int.Parse(Console.ReadLine());
- string transport = Console.ReadLine().ToLower();
- double adultsPay = 0;
- double studentsPay = 0;
- double discount = 1;
- if (adults + students >= 50)
- {
- discount = 0.5;
- }
- if (transport == "train")
- {
- adultsPay = 24.99;
- studentsPay = 14.99;
- }
- else if (transport == "bus")
- {
- adultsPay = 32.50;
- studentsPay = 28.50;
- }
- else if (transport == "boat")
- {
- adultsPay = 42.99;
- studentsPay = 39.99;
- }
- else if (transport == "airplane")
- {
- adultsPay = 70.00;
- studentsPay = 50.00;
- }
- double transportPrice = (adults * adultsPay + studentsPay * students) * discount;
- double hotelPrice = 82.99 * nights;
- double totalPayWithCommision = (transportPrice * 2 + hotelPrice) * 1.10;
- Console.WriteLine("{0:f2}", totalPayWithCommision);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement