Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.Design;
- using System.Globalization;
- using System.Reflection;
- using System.Runtime.ConstrainedExecution;
- using System.Security.Cryptography;
- namespace SomeExcercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fisherMen = int.Parse(Console.ReadLine());
- double rent = 0;
- double finalPrice = 0;
- double discount = double.Parse(Console.ReadLine());
- switch (season)
- {
- case "Spring":
- rent = 3000;
- if (fisherMen <= 6)
- {
- finalPrice = rent - (rent * 0.10);
- finalPrice -= finalPrice * 0.10;
- if (fisherMen % 2 == 0 && season == "Spring")
- {
- finalPrice -= finalPrice * 0.10;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (fisherMen >= 7 && fisherMen <= 11)
- {
- finalPrice -= finalPrice * 0.15;
- if (fisherMen % 2 == 0 && season == "Spring")
- {
- finalPrice -= finalPrice * 0.15;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (finalPrice >= 12)
- {
- finalPrice -= finalPrice * 0.25;
- if (fisherMen % 2 == 0 && season == "Spring")
- {
- finalPrice -= finalPrice * 0.25;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- break;
- //Important
- case "Summer":
- rent = 4200;
- if (fisherMen <= 6)
- {
- finalPrice = rent - (rent * 0.15);
- if (fisherMen % 2 == 0)
- {
- finalPrice -= finalPrice * 0.05;
- }
- else
- {
- finalPrice = finalPrice;
- }
- }
- //Important
- else if (fisherMen >= 7 && fisherMen <= 11)
- {
- finalPrice = rent - (rent * 0.15);
- if (fisherMen % 2 == 0)
- {
- finalPrice -= finalPrice * 0.15;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (finalPrice >= 12)
- {
- finalPrice -= finalPrice * 0.25;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.25;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- break;
- case "Autumn":
- finalPrice = rent * 4200;
- rent = 4200;
- if (fisherMen <= 6)
- {
- finalPrice -= finalPrice * 0.10;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.10;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (fisherMen >= 7 && fisherMen <= 11)
- {
- finalPrice -= finalPrice * 0.15;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.15;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (finalPrice >= 12)
- {
- finalPrice -= finalPrice * 0.25;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.25;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- break;
- case "Winter":
- finalPrice = rent * 2600;
- rent = 2600;
- if (fisherMen <= 6)
- {
- finalPrice -= finalPrice * 0.10;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.10;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (fisherMen >= 7 && fisherMen <= 11)
- {
- finalPrice -= finalPrice * 0.15;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.15;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- else if (finalPrice >= 12)
- {
- finalPrice -= finalPrice * 0.25;
- if (finalPrice % 2 == 0)
- {
- finalPrice -= fisherMen * 0.25;
- }
- else
- {
- finalPrice -= finalPrice * 0.05;
- }
- }
- break;
- }
- if (budget > finalPrice)
- {
- Console.WriteLine($"Yes! You have {(budget - finalPrice):f2} leva left.");
- }
- else if (budget < finalPrice)
- {
- Console.WriteLine($"Not enough money! You need {(finalPrice - budget):f2} leva ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment