Advertisement
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)
- {
- const double Boat_Rent_Spring = 3000;
- const double Boat_Rent_Summer_Autumn = 4200;
- const double Boat_Rent_Winter = 2600;
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fisherman = int.Parse(Console.ReadLine());
- double totalMoney = 0;
- switch (season)
- {
- case "Winter":
- totalMoney = Boat_Rent_Winter;
- break;
- case "Spring":
- totalMoney = Boat_Rent_Spring;
- break;
- case "Summer":
- case "Autumn":
- totalMoney = Boat_Rent_Summer_Autumn;
- break;
- }
- if (fisherman <= 6)
- {
- totalMoney -= totalMoney * 0.10;
- }
- else if ( fisherman <= 11)
- {
- totalMoney -= totalMoney * 0.15;
- }
- else
- {
- totalMoney -= totalMoney * 0.25;
- }
- if (fisherman % 2 == 0 && season != "Autumn")
- {
- totalMoney -= totalMoney * 0.05;
- }
- if (budget >= totalMoney)
- {
- double moneyLeft = budget - totalMoney;
- Console.WriteLine($"Yes! You have {moneyLeft:f2} leva left.");
- }
- else
- {
- double moneyNeeded = totalMoney - budget;
- Console.WriteLine($"Not enough money! You need {moneyNeeded:f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement