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 Fishing_Boat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double groupBudget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishermansCount = int.Parse(Console.ReadLine());
- totalSum = 0.0;
- if (season == "Spring")
- {
- totalSum = 3000.0;
- if (fishermansCount <= 6)
- {
- totalSum -= totalSum * 0.1;
- }
- else if (fishermansCount > 6 && fishermansCount <= 11)
- {
- totalSum -= totalSum * 0.15;
- }
- else if (fishermansCount >= 12)
- {
- totalSum -= totalSum * 0.25;
- }
- }
- else if (season == "Summer" || season == "Autumn")
- {
- totalSum = 4200.0;
- if (fishermansCount <= 6)
- {
- totalSum -= totalSum * 0.1;
- }
- else if (fishermansCount > 6 && fishermansCount <= 11)
- {
- totalSum -= totalSum * 0.15;
- }
- else if (fishermansCount >= 12)
- {
- totalSum -= totalSum * 0.25;
- }
- }
- else if (season == "Winter")
- {
- totalSum = 2600.0;
- if (fishermansCount <= 6)
- {
- totalSum -= totalSum * 0.1;
- }
- else if (fishermansCount > 6 && fishermansCount <= 11)
- {
- totalSum -= totalSum * 0.15;
- }
- else if (fishermansCount >= 12)
- {
- totalSum -= totalSum * 0.25;
- }
- }
- if (fishermansCount % 2 == 0 && season != "Autumn")
- {
- totalSum -= totalSum * 0.05;
- }
- if (groupBudget >= totalSum)
- {
- Console.WriteLine($"Yes! You have {groupBudget - totalSum:F2} leva left.");
- }
- else if (groupBudget < totalSum)
- {
- Console.WriteLine($"Not enough money! You need {totalSum - groupBudget:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement