Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Fishing_Boat
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string seson = Console.ReadLine();
- int numberFishermans = int.Parse(Console.ReadLine());
- double priceBoat = 0.00;
- double promo = 1.00;
- double extrapromo = 1.00;
- if (seson == "Spring")
- {
- priceBoat = 3000.00;
- }
- else if (seson == "Summer" || seson == "Autumn")
- {
- priceBoat = 4200.00;
- }
- else if (seson == "Winter")
- {
- priceBoat = 2600.00;
- }
- if (numberFishermans <= 6)
- {
- promo = 0.90;
- }
- else if (numberFishermans > 7 && numberFishermans <= 11)
- {
- promo = 0.85;
- }
- else if (numberFishermans > 12)
- {
- promo = 0.75;
- }
- if ((numberFishermans % 2 == 0) && seson != "Autumn")
- {
- extrapromo = 0.95;
- }
- double finPrice = (priceBoat * promo) * extrapromo;
- double balance = budget - finPrice;
- if (balance >= 0)
- {
- Console.WriteLine($"Yes! You have {balance:F2} leva left.");
- }
- else if (balance < 0)
- {
- balance = balance * -1;
- Console.WriteLine($"Not enough money! You need {balance:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement