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 FishingBoat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double groupBudget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fisherCount = int.Parse(Console.ReadLine());
- double price = 0;
- double rent = 0;
- if (season == "Spring")
- {
- rent = 3000;
- if (fisherCount <= 6)
- {
- price = rent - 0.1 * rent;
- }
- else if (fisherCount > 7 && fisherCount <= 11)
- {
- price = rent - 0.15 * rent;
- }
- else if (fisherCount > 12)
- {
- price = rent - 0.25 * rent;
- }
- else if (fisherCount % 2 == 0) {
- price = rent + 0.05 * rent;
- }
- else { }
- }
- else if (season == "Summer")
- {
- rent = 4200;
- if (fisherCount <= 6)
- {
- price = rent - 0.1 * rent;
- }
- else if (fisherCount > 7 && fisherCount <= 11)
- {
- price = rent - 0.15 * rent;
- }
- else if (fisherCount > 12)
- {
- price = rent - 0.25 * rent;
- }
- else if (fisherCount % 2 == 0)
- {
- price = rent + 0.05 * rent;
- }
- else { }
- }
- else if (season == "Autumn")
- {
- rent = 4200;
- if (fisherCount <= 6)
- {
- price = rent - 0.1 * rent;
- }
- else if (fisherCount > 7 && fisherCount <= 11)
- {
- price = rent - 0.15 * rent;
- }
- else if (fisherCount > 12)
- {
- price = rent - 0.25 * rent;
- }
- else { }
- }
- else if (season == "Winter")
- {
- rent = 2600;
- if (fisherCount <= 6)
- {
- price = rent - 0.1 * rent;
- }
- else if (fisherCount > 7 && fisherCount <= 11)
- {
- price = rent - 0.15 * rent;
- }
- else if (fisherCount > 12)
- {
- price = rent - 0.25 * rent;
- }
- else if (fisherCount % 2 == 0)
- {
- price = rent + 0.05 * rent;
- }
- else { }
- }
- else { }
- if (groupBudget > price)
- {
- double moneyLeave = groupBudget - price;
- Console.WriteLine($"Yes! You have {moneyLeave:F2} leva left.");
- }
- else
- {
- double moneyNeed = price - groupBudget;
- Console.WriteLine($"Not enough money! You need {moneyNeed:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement