Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var nights = int.Parse(Console.ReadLine());
- var destenation = Console.ReadLine().ToLower(); // “Miami”, “Canary Islands”, “Philippines”.
- var transport = Console.ReadLine().ToLower(); // “train”, “bus” или “airplane”
- double sumChildren = 0;
- double sumAdults = 0;
- double sumdestanation = 0;
- double sumTickets = 0;
- double sumTotal = 0;
- if (nights <= 10)
- {
- if (destenation == "miami")
- {
- sumAdults = (sumAdults + 24.99) * nights * 2;
- sumChildren = (sumChildren + 14.99) * nights * 3;
- }
- if (destenation == "canary islands")
- {
- sumAdults = (sumAdults + 32.50) * nights * 2;
- sumChildren = (sumChildren + 28.50) * nights * 3;
- }
- if (destenation == "philippines")
- {
- sumAdults = 42.99 * nights * 2;
- sumChildren = 39.99 * nights * 3;
- }
- }
- else if (nights <= 15)
- {
- if (destenation == "miami")
- {
- sumAdults = + 22.99 * nights * 2;
- sumChildren = + 11.99 * nights * 3;
- }
- if (destenation == "canary islands")
- {
- sumAdults = (sumAdults + 30.50) * nights * 2;
- sumChildren = (sumChildren + 25.60) * nights * 3;
- }
- if (destenation == "philippines")
- {
- sumAdults = (sumAdults + 41) * nights * 2;
- sumChildren = (sumChildren + 36) * nights * 3;
- }
- }
- else if (nights > 15)
- {
- if (destenation == "miami")
- {
- sumAdults = (sumAdults + 20) * nights * 2;
- sumChildren = (sumChildren + 10) * nights * 3;
- }
- if (destenation == "canary islands")
- {
- sumAdults = (sumAdults + 28) * nights * 2;
- sumChildren = (sumChildren + 22) * nights * 3;
- }
- if (destenation == "philippines")
- {
- sumAdults = (sumAdults + 38.50) * nights * 2;
- sumChildren = (sumChildren + 32.40) * nights * 3;
- }
- }
- sumdestanation = (sumAdults + sumChildren) * 1.25; // 25% dog expen
- if (transport == "train")
- {
- sumTickets = (2 * 22.30) + (3 * 12.50); // 2 adult, 3 children
- }
- if (transport == "bus")
- {
- sumTickets = (2 * 45) + (3 * 37);
- }
- if (transport == "airplane")
- {
- sumTickets = (2 * 90) + (3 * 68.50);
- }
- sumTotal = sumdestanation + sumTickets;
- Console.WriteLine($"{sumTotal:f3}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment