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 FishingBoat
- {
- class FishingBoat
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishmen = int.Parse(Console.ReadLine());
- double currentPrice = 0.00;
- double finalCurrentPrice = 0.00;
- if (season == "spring")
- {
- if (fishmen <= 6) currentPrice = 3000 - 3000 * 0.1;
- else if (fishmen >= 7 && fishmen <= 11) currentPrice = 3000 - 3000 * 0.15;
- else if (fishmen > 12) currentPrice = 3000 - 3000 * 0.25;
- }
- else if (season == "summer" || season == "autumn")
- {
- if (fishmen <= 6) currentPrice = 4200 - 4200 * 0.1;
- else if (fishmen >= 7 && fishmen <= 11) currentPrice = 4200 - 4200 * 0.15;
- else if (fishmen > 12) currentPrice = 4200 - 4200 * 0.25;
- }
- else if (season == "winter")
- {
- if (fishmen <= 6) currentPrice = 2600 - 2600 * 0.1;
- else if (fishmen >= 7 && fishmen <= 11) currentPrice = 2600 - 2600 * 0.15;
- else if (fishmen > 12) currentPrice = 2600 - 2600 * 0.25;
- }
- if (fishmen % 2 == 0 && season != "autumn") finalCurrentPrice = currentPrice - (currentPrice * 0.05);
- else finalCurrentPrice = currentPrice;
- if (finalCurrentPrice <= budget)
- {
- Console.WriteLine($"Yes! You have {Math.Round((budget - finalCurrentPrice),2)} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {Math.Round((finalCurrentPrice - budget),2)} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement