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 forum
- {
- class Program
- {
- static void Main(string[] args)
- {
- //1. Read Input
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishermanCount = int.Parse(Console.ReadLine());
- //2. Manipulate Data
- double boatReant = 0;
- switch (season)
- {
- case "Spring":
- boatReant = 3000;
- break;
- case "Summer":
- case "Autumn":
- boatReant = 4200;
- break;
- case "Winter":
- boatReant = 2600;
- break;
- }
- if (fishermanCount <= 6)
- boatReant -= boatReant * 0.1;
- else if (fishermanCount >= 7 && fishermanCount <= 11)
- boatReant -= boatReant * 0.15;
- else
- boatReant -= boatReant * 0.25;
- if (fishermanCount % 2 == 0 && season != "Autumn")
- boatReant -= boatReant * 0.05;
- //3. Print Result
- double moneyResult = Math.Abs(budget - boatReant);
- if (budget >= boatReant)
- {
- Console.WriteLine($"Yes! You have {moneyResult:F2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {moneyResult:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement