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