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