Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string tipeCruis = Console.ReadLine();
- string tipeRoom = Console.ReadLine();
- int countNights = int.Parse(Console.ReadLine());
- double price = 0;
- double totalPrice = 0;
- switch (tipeCruis)
- {
- case "Mediterranean":
- if (tipeRoom == "standard cabin")
- {
- price = 27.5;
- }
- else if (tipeRoom == "cabin with balcony")
- {
- price = 30.2;
- }
- else if (tipeRoom == "apartament")
- {
- price = 40.5;
- }
- break;
- case "Adriatic":
- if (tipeRoom == "standard cabin")
- {
- price = 22.99;
- }
- else if (tipeRoom == "cabin with balcony")
- {
- price = 25;
- }
- else if (tipeRoom == "apartament")
- {
- price = 34.99;
- }
- break;
- case "Aegean":
- if (tipeRoom == "standard cabin")
- {
- price = 23;
- }
- else if (tipeRoom == "cabin with balcony")
- {
- price = 26.6;
- }
- else if (tipeRoom == "apartament")
- {
- price = 39.8;
- }
- break;
- default:
- break;
- }
- if (countNights > 7)
- {
- totalPrice = (countNights * price * 4) * 0.75;
- }
- else
- {
- totalPrice = countNights * price * 4;
- }
- Console.WriteLine($"Annie's holiday in the {tipeCruis} sea costs {totalPrice:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement