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