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 _05.Fishing_Boat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double groupBudget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- double fishersCount = double.Parse(Console.ReadLine());
- double currentPrice = 0;
- double totalPrice = 0;
- if (season == "Spring")
- {
- if (fishersCount <= 6)
- {
- currentPrice = 3000;
- totalPrice = currentPrice - (currentPrice * 10 / 100);
- }
- else if (fishersCount > 6 && fishersCount <= 11)
- {
- currentPrice = 3000;
- totalPrice = currentPrice - (currentPrice * 15 / 100);
- }
- else if (fishersCount > 11)
- {
- currentPrice = 3000;
- totalPrice = currentPrice - (currentPrice * 25 / 100);
- }
- }
- else if (season == "Summer")
- {
- if (fishersCount <= 6)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 10 / 100);
- }
- else if (fishersCount > 6 && fishersCount <= 11)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 15 / 100);
- }
- else if (fishersCount > 11)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 25 / 100);
- }
- }
- else if (season == "Winter")
- {
- if (fishersCount <= 6)
- {
- currentPrice = 2600;
- totalPrice = currentPrice - (currentPrice * 10 / 100);
- }
- else if (fishersCount > 6 && fishersCount <= 11)
- {
- currentPrice = 2600;
- totalPrice = currentPrice - (currentPrice * 15 / 100);
- }
- else if (fishersCount > 11)
- {
- currentPrice = 2600;
- totalPrice = currentPrice - (currentPrice * 25 / 100);
- }
- }
- else if (season == "Autumn")
- {
- if (fishersCount <= 6)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 10 / 100);
- }
- else if (fishersCount > 6 && fishersCount <= 11)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 15 / 100);
- }
- else if(fishersCount > 11)
- {
- currentPrice = 4200;
- totalPrice = currentPrice - (currentPrice * 25 / 100);
- }
- }
- double moneyMiss = Math.Abs(groupBudget- totalPrice);
- if (season == "Spring" || season == "Summer" || season == "Winter" && fishersCount % 2 == 0)
- {
- totalPrice = totalPrice - (totalPrice * 5 / 100);
- }
- if (groupBudget < totalPrice)
- {
- Console.WriteLine($"Not enough money! You need {moneyMiss:f2} leva.");
- }
- else if (groupBudget >= totalPrice)
- {
- Console.WriteLine($"Yes! You have {moneyMiss:f2} leva left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment