Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fishing_Boat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double Budget = double.Parse(Console.ReadLine());
- string Season = Console.ReadLine();
- double CountFisher = double.Parse(Console.ReadLine());
- double PriceBoat = 0;
- if (Season== "Spring")
- {
- PriceBoat = 3000;
- if (CountFisher<=6)
- {
- PriceBoat = PriceBoat - (PriceBoat * 10 / 100);
- }
- else if (CountFisher <= 11&& CountFisher >= 7)
- {
- PriceBoat = PriceBoat - (PriceBoat * 15 / 100);
- }
- else if (CountFisher >= 12)
- {
- PriceBoat = PriceBoat - (PriceBoat * 25 / 100);
- }
- }
- else if (Season == "Summer"||Season == "Autumn")
- {
- PriceBoat = 4200;
- if (CountFisher <= 6)
- {
- PriceBoat = PriceBoat - (PriceBoat * 10 / 100);
- }
- else if (CountFisher <= 11 && CountFisher >= 7)
- {
- PriceBoat = PriceBoat - (PriceBoat * 15 / 100);
- }
- else if (CountFisher >= 12)
- {
- PriceBoat = PriceBoat - (PriceBoat * 25 / 100);
- }
- }
- else if (Season == "Winter")
- {
- PriceBoat = 2600;
- if (CountFisher <= 6)
- {
- PriceBoat = PriceBoat - (PriceBoat * 10 / 100);
- }
- else if (CountFisher <= 11 && CountFisher >= 7)
- {
- PriceBoat = PriceBoat - (PriceBoat * 15 / 100);
- }
- else if (CountFisher >= 12)
- {
- PriceBoat = PriceBoat - (PriceBoat * 25 / 100);
- }
- }
- if (Season != "Autumn"&& CountFisher%2==0)
- {
- PriceBoat = PriceBoat - (PriceBoat * 5 / 100);
- }
- double Money = Math.Abs(Budget - PriceBoat);
- if(Budget>= PriceBoat)
- {
- Console.WriteLine($"Yes! You have {Money:f2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {Money:f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment