Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TravelAgency
- {
- class Program
- {
- static void Main(string[] args)
- {
- int x = 0;
- double price = 0;
- string town = Console.ReadLine();
- string pack = Console.ReadLine();
- string vip = Console.ReadLine();
- int days = int.Parse(Console.ReadLine());
- if (days > 7)
- {
- days -= 1;
- }
- if (town != "Bansko" && town != "Borovets" && town != "Varna"
- && town != "Burgas")
- {
- Console.WriteLine("Invalid input!");
- x = 0;
- } else
- {
- x = 1;
- }
- if (x == 1)
- {
- if ((town == "Bansko" || town == "Borovets") &&
- pack != "withEquipment" && pack != "noEquipment")
- {
- Console.WriteLine("Invalid input!");
- x = 0;
- }
- else if ((town == "Varna" || town == "Burgas") &&
- pack != "withBreakfast" && pack != "noBreakfast")
- {
- Console.WriteLine("Invalid input!");
- x = 0;
- }
- else
- {
- x = 1;
- }
- }
- if (x == 1)
- {
- if (days < 1)
- {
- Console.WriteLine("Days must be positive number!");
- x = 0;
- }
- else
- {
- x = 1;
- }
- }
- if (x == 1)
- {
- if (town == "Bansko" || town == "Borovets")
- {
- if (pack == "withEquipment")
- {
- price = 100 * days;
- if (vip == "yes")
- {
- price *= 0.9;
- }
- }
- else if (pack == "noEquipment")
- {
- price = 80 * days;
- if (vip == "yes")
- {
- price *= 0.95;
- }
- }
- }
- else if (town == "Varna" || town == "Burgas")
- {
- if (pack == "withBreakfast")
- {
- price = 130 * days;
- if (vip == "yes")
- {
- price *= 0.88;
- }
- }
- else if (pack == "noBreakfast")
- {
- price = 100 * days;
- if (vip == "yes")
- {
- price *= 0.93;
- }
- }
- }
- }
- if (x == 1)
- {
- Console.WriteLine("The price is " + $"{price:f2}" + "lv! Have a nice time!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement