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