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