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