Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace test3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int numFishermen = int.Parse(Console.ReadLine());
- double rentalPrice = 0;
- switch (season)
- {
- case "Spring":
- rentalPrice = 3000;
- break;
- case "Summer":
- rentalPrice = 4200;
- break;
- case "Autumn":
- rentalPrice = 4200;
- break;
- case "Winter":
- rentalPrice = 2600;
- break;
- }
- if (numFishermen <= 6)
- {
- rentalPrice = rentalPrice - (rentalPrice * 0.10);
- }
- else if (numFishermen <= 11)
- {
- rentalPrice = rentalPrice - (rentalPrice * 0.15);
- }
- else
- {
- rentalPrice = rentalPrice - (rentalPrice * 0.25);
- }
- if (numFishermen % 2 == 0 && season != "Autumn")
- {
- rentalPrice = rentalPrice - (rentalPrice * 0.05);
- }
- if (rentalPrice > budget)
- {
- Console.WriteLine($"Not enough money! You need {rentalPrice - budget:F2} leva.");
- }
- else
- {
- Console.WriteLine($"Yes! You have {budget - rentalPrice:F2} leva left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement