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 budgetGroup = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int countFihers = int.Parse(Console.ReadLine());
- double priceShip = 0;
- switch (season)
- {
- case "Spring":
- priceShip = 3000;
- break;
- case "Summer":
- priceShip = 4200;
- break;
- case "Autumn":
- priceShip = 4200;
- break;
- case "Winter":
- priceShip = 2600;
- break;
- }
- if (countFihers <= 6)
- {
- priceShip = priceShip * 0.9;
- }
- else if (countFihers >= 7 && countFihers <= 11)
- {
- priceShip = priceShip * 0.85;
- }
- else if (countFihers >= 12)
- {
- priceShip = priceShip * 0.75;
- }
- if (countFihers % 2 == 0 && season != "Autumn")
- {
- priceShip = priceShip * 0.95;
- }
- if (budgetGroup > priceShip)
- {
- double left = budgetGroup - priceShip;
- Console.WriteLine($"Yes! You have {left:f2} leva left.");
- }
- else if (budgetGroup < priceShip)
- {
- double need = priceShip - budgetGroup;
- Console.WriteLine($"Not enough money! You need {need:f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment