Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.Movie_Destination
- {
- class P03_MovieDestination
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string destination = Console.ReadLine(); // "Dubai", "Sofia" ΠΈ "London"
- string season = Console.ReadLine(); // "Summer" ΠΈ "Winter"
- int days = int.Parse(Console.ReadLine());
- double pricePerDay = 0;
- switch (destination)
- {
- case "Dubai":
- switch (season)
- {
- case "Summer": pricePerDay = 40000; break;
- case "Winter": pricePerDay = 45000; break;
- }
- break;
- case "Sofia":
- switch (season)
- {
- case "Summer": pricePerDay = 12500; break;
- case "Winter": pricePerDay = 17000; break;
- }
- break;
- case "London":
- switch (season)
- {
- case "Summer": pricePerDay = 20250; break;
- case "Winter": pricePerDay = 24000; break;
- }
- break;
- }
- double totalPrice = pricePerDay * days;
- if(destination == "Dubai")
- {
- totalPrice = totalPrice * 0.7;
- }
- else if(destination == "Sofia")
- {
- totalPrice = totalPrice * 1.25;
- }
- if(budget >= totalPrice)
- {
- double leftMoney = budget - totalPrice;
- Console.WriteLine($"The budget for the movie is enough! We have {leftMoney:F2} leva left!");
- }
- else
- {
- double needMoney = totalPrice - budget;
- Console.WriteLine($"The director needs {needMoney:F2} leva more!");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment