Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace T3IvanovisHoliday
- {
- class Program
- {
- static void Main(string[] args)
- {
- int nightsToStay = int.Parse(Console.ReadLine());
- string destination = Console.ReadLine().ToLower();
- string transport = Console.ReadLine().ToLower();
- double stayPriceAdults = 0;
- double stayPriceKids = 0;
- switch (destination)
- {
- case "miami":
- if (nightsToStay >= 1 && nightsToStay <= 10)
- {
- stayPriceAdults = 24.99;
- stayPriceKids = 14.99;
- } else if (nightsToStay >= 11 && nightsToStay <= 15)
- {
- stayPriceAdults = 22.99;
- stayPriceKids = 11.99;
- } else if (nightsToStay > 15)
- {
- stayPriceAdults = 20.0;
- stayPriceKids = 10.0;
- }
- break;
- case "canary islands":
- if (nightsToStay >= 1 && nightsToStay <= 10)
- {
- stayPriceAdults = 32.5;
- stayPriceKids = 28.5;
- }
- else if (nightsToStay >= 11 && nightsToStay <= 15)
- {
- stayPriceAdults = 30.5;
- stayPriceKids = 25.6;
- }
- else if (nightsToStay > 15)
- {
- stayPriceAdults = 28.0;
- stayPriceKids = 22.0;
- }
- break;
- case "philippines":
- if (nightsToStay >= 1 && nightsToStay <= 10)
- {
- stayPriceAdults = 42.99;
- stayPriceKids = 39.99;
- }
- else if (nightsToStay >= 11 && nightsToStay <= 15)
- {
- stayPriceAdults = 41.0;
- stayPriceKids = 36.0;
- }
- else if (nightsToStay > 15)
- {
- stayPriceAdults = 38.5;
- stayPriceKids = 32.4;
- }
- break;
- }
- double totalPriceForStay = nightsToStay * (2 * stayPriceAdults + 3 * stayPriceKids);
- totalPriceForStay += totalPriceForStay * 0.25; //0.25 za kucheto
- double transportPriceAdults = 0;
- double transportPriceKids = 0;
- switch (transport)
- {
- case "train":
- transportPriceAdults = 22.3;
- transportPriceKids = 12.5;
- break;
- case "bus":
- transportPriceAdults = 45.0;
- transportPriceKids = 37.0;
- break;
- case "airplane":
- transportPriceAdults = 90.0;
- transportPriceKids = 68.5;
- break;
- }
- double totalPriceForTransport = 2 * transportPriceAdults + 3 * transportPriceKids;
- double totalPrice = totalPriceForStay + totalPriceForTransport;
- Console.WriteLine($"{totalPrice:F3}");
- //main ends here
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement