Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- string cruise = Console.ReadLine();
- string cabin = Console.ReadLine();
- int overnight = int.Parse(Console.ReadLine());
- double price = 0.0;
- if (cruise == "Mediterranean")
- {
- if (cabin == "standard cabin")
- {
- price = 27.50;
- }
- else if (cabin == "cabin with balcony")
- {
- price = 30.20;
- }
- else
- {
- price = 40.50;
- }
- }
- else if (cruise == "Adriatic")
- {
- if (cabin == "standard cabin")
- {
- price = 22.99;
- }
- else if (cabin == "cabin with balcony")
- {
- price = 25.00;
- }
- else
- {
- price = 34.99;
- }
- }
- else
- {
- if (cabin == "standard cabin")
- {
- price = 23.00;
- }
- else if (cabin == "cabin with balcony")
- {
- price = 26.60;
- }
- else
- {
- price = 39.80;
- }
- }
- double sum = price * 4 * overnight;
- if (overnight > 7)
- {
- sum *= 0.75;
- }
- Console.WriteLine($"Annie's holiday in the {cruise} sea costs {sum:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement