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)
- {
- var adultsCount = double.Parse(Console.ReadLine());
- var studenCount = double.Parse(Console.ReadLine());
- var nights = int.Parse(Console.ReadLine()) * 82.99;
- string transportType = (Console.ReadLine());
- switch (transportType)
- {
- case "train":
- if (adultsCount + studenCount >= 50)
- {
- adultsCount = (adultsCount * 24.99) * 0.5;
- studenCount = (studenCount * 14.99) * 0.5;
- }
- else
- {
- adultsCount = adultsCount * 24.99;
- studenCount = studenCount * 14.99;
- }
- break;
- case "bus":
- adultsCount = adultsCount * 32.50;
- studenCount = studenCount * 28.50;
- break;
- case "boat":
- adultsCount = adultsCount * 42.99;
- studenCount = studenCount * 39.99;
- break;
- case "airplane":
- adultsCount = adultsCount * 70.00;
- studenCount = studenCount * 50.00;
- break;
- }
- Console.WriteLine($"{0.1 * (2 * (adultsCount + studenCount) + nights) + (2 * (adultsCount + studenCount) + nights):f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment