Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FishingBoat
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int peopleCount = int.Parse(Console.ReadLine());
- decimal price = 0m;
- switch(season)
- {
- case "Spring":
- price = 3000m;
- break;
- case "Summer":
- price = 4200m;
- break;
- case "Autumn":
- price = 4200m;
- break;
- case "Winter":
- price = 2600m;
- break;
- }
- if (peopleCount<=6)
- {
- price *= 0.90m;
- }
- else if (peopleCount>=7 && peopleCount<=11)
- {
- price *= 0.85m;
- }
- else if (peopleCount>12)
- {
- price = price - (price * 0.25m);
- }
- decimal totalPrice = price;
- if (season == "Spring" && season=="Summer" && season=="Winter" && peopleCount % 2 == 0)
- {
- price = totalPrice - (totalPrice * 0.95m);
- }
- if (price > budget)
- {
- Console.WriteLine($"Not enough money! You need {(price - budget):f2} leva.");
- }
- else
- {
- Console.WriteLine($"Yes! You have {(budget-price):f2} leva left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement