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)
- {
- string town = Console.ReadLine();
- string pack = Console.ReadLine();
- string vip = Console.ReadLine();
- int day = int.Parse(Console.ReadLine());
- double sum = 0;
- switch (town)
- {
- case "Bansko":
- case "Borovets":
- switch (pack)
- {
- case "withEquipment":
- switch (vip)
- {
- case "yes":
- sum = day * 90;
- if (day > 7)
- {
- sum = (day - 1) * 90;
- }
- break;
- case "no":
- sum = day * 100;
- if (day > 7)
- {
- sum = (day - 1) * 100;
- }
- break;
- }
- break;
- case "noEquipment":
- switch (vip)
- {
- case "yes":
- sum = day * 76;
- if (day > 7)
- {
- sum = (day - 1) * 76;
- }
- break;
- case "no":
- sum = day * 80;
- if (day > 7)
- {
- sum = (day - 1) * 80;
- }
- break;
- }
- break;
- }
- break;
- case "Varna":
- case "Burgas":
- switch (pack)
- {
- case "withBreakfast":
- switch (vip)
- {
- case "yes":
- sum = day * 114.4;
- if (day > 7)
- {
- sum = (day - 1) * 114.4;
- }
- break;
- case "no":
- sum = day * 130;
- if (day > 7)
- {
- sum = (day - 1) * 130;
- }
- break;
- }
- break;
- case "noBreakfast":
- switch (vip)
- {
- case "yes":
- sum = day * 93;
- if (day > 7)
- {
- sum = (day - 1) * 93;
- }
- break;
- case "no":
- sum = day * 100;
- if (day > 7)
- {
- sum = (day - 1) * 100;
- }
- break;
- }
- break;
- }
- break;
- }
- if (day < 1)
- {
- Console.WriteLine("Days must be positive number!");
- }
- else if (town != "Bansko" && town != "Borovets" && town != "Varna" && town != "Burgas"
- || pack != "noEquipment" && pack != "withEquipment" && pack != "noBreakfast" && pack != "withBreakfast"
- || vip != "yes" && vip != "no")
- {
- Console.WriteLine("Invalid input!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement