Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp14
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int numberOfFishers = int.Parse(Console.ReadLine());
- double discountForSeason;
- double discountForEven;
- double price = 0.0;
- double moneyLeft;
- double moneyNeed;
- int priceForBoatInSpring = 3000;
- int priceForBoatInSummerAndAutumn = 4200;
- int priceForBoatInWinter = 2600;
- switch (season)
- {
- case "Spring":
- if (numberOfFishers <= 6)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSpring / 100) * 10;
- discountForEven = (priceForBoatInSpring / 100) * 5;
- price = priceForBoatInSpring - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSpring / 100) * 10;
- price = priceForBoatInSpring - discountForSeason;
- }
- }
- else if (numberOfFishers >= 7 && numberOfFishers <= 11)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSpring / 100) * 15;
- discountForEven = (priceForBoatInSpring / 100) * 5;
- price = priceForBoatInSpring - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSpring / 100) * 10;
- price = priceForBoatInSpring - discountForSeason;
- }
- }
- else if (numberOfFishers >= 12)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSpring / 100) * 25;
- discountForEven = (priceForBoatInSpring / 100) * 5;
- price = priceForBoatInSpring - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSpring / 100) * 10;
- price = priceForBoatInSpring - discountForSeason;
- }
- }
- break;
- case "Summer":
- if (numberOfFishers <= 6)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 10;
- discountForEven = (priceForBoatInSummerAndAutumn / 100) * 5;
- price = priceForBoatInSummerAndAutumn - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 10;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- }
- else if (numberOfFishers >= 7 && numberOfFishers <= 11)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 15;
- discountForEven = (priceForBoatInSummerAndAutumn / 100) * 5;
- price = priceForBoatInSummerAndAutumn - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 15;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- }
- else if (numberOfFishers >= 12)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 25;
- discountForEven = (priceForBoatInSummerAndAutumn / 100) * 5;
- price = priceForBoatInSummerAndAutumn - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 25;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- }
- break;
- case "Autumn":
- if (numberOfFishers <= 6)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 10;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- else if (numberOfFishers >= 7 && numberOfFishers <= 11)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 15;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- else if (numberOfFishers >= 12)
- {
- discountForSeason = (priceForBoatInSummerAndAutumn / 100) * 25;
- price = priceForBoatInSummerAndAutumn - discountForSeason;
- }
- break;
- case "Winter":
- if (numberOfFishers <= 6)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInWinter / 100) * 10;
- discountForEven = (priceForBoatInWinter / 100) * 5;
- price = priceForBoatInWinter - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInWinter / 100) * 10;
- price = priceForBoatInWinter - discountForSeason;
- }
- }
- else if (numberOfFishers >= 7 && numberOfFishers <= 11)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInWinter / 100) * 15;
- discountForEven = (priceForBoatInWinter / 100) * 5;
- price = priceForBoatInWinter - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInWinter / 100) * 15;
- price = priceForBoatInWinter - discountForSeason;
- }
- }
- else if (numberOfFishers >= 12)
- {
- if (numberOfFishers % 2 == 0)
- {
- discountForSeason = (priceForBoatInWinter / 100) * 25;
- discountForEven = (priceForBoatInWinter / 100) * 5;
- price = priceForBoatInWinter - discountForEven - discountForSeason;
- }
- else
- {
- discountForSeason = (priceForBoatInWinter / 100) * 25;
- price = priceForBoatInWinter - discountForSeason;
- }
- }
- break;
- }
- if (budget > price)
- {
- moneyLeft = budget - price;
- Console.WriteLine($"Yes! You have {moneyLeft:F2} leva left.");
- }
- else
- {
- moneyNeed = price - budget;
- Console.WriteLine($"Not enough money! You need {moneyNeed:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement