Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.TravelAgency
- {
- class TravelAgency
- {
- static void Main(string[] args)
- {
- string nameCity = Console.ReadLine();
- string packet = Console.ReadLine();
- string vip = Console.ReadLine();
- double daysStay = double.Parse(Console.ReadLine());
- double price = 0.0;
- if (nameCity == "Bansko" || nameCity == "Borovets")
- {
- if (packet == "withEquipment")
- {
- price = 100.0;
- if (vip == "yes")
- {
- price = price * 0.90;
- }
- }
- else if (packet == "noEquipment")
- {
- price = 80.0;
- if (vip == "yes")
- {
- price = price * 0.95;
- }
- }
- }
- else if (nameCity == "Varna" || nameCity == "Burgas")
- {
- if (packet == "withBreakfast")
- {
- price = 130.0;
- if (vip == "yes")
- {
- price = price * 0.88;
- }
- }
- else if (packet == "noBreakfast")
- {
- price = 100.0;
- if (vip == "yes")
- {
- price = price * 0.93;
- }
- }
- }
- else if (nameCity != "Bansko" || nameCity != "Borovets" || nameCity != "Varna" || nameCity != "Burgas")
- {
- Console.WriteLine("Invalid input!");
- return;
- }
- double allNights = price * daysStay;
- if (daysStay < 1)
- {
- Console.WriteLine("Days must be positive number!");
- }
- else
- {
- Console.WriteLine($"The price is {allNights:f2}lv! Have a nice time!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment