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 Fishing_Boat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string sezone = Console.ReadLine();
- int numOfFisherman = int.Parse(Console.ReadLine());
- double rent = 0;
- double discount = 0;
- double sum = 0;
- if (sezone == "Spring")
- {
- rent = 3000;
- if (numOfFisherman<=6)
- {
- discount= rent * 0.1;
- rent = rent - discount;
- }
- else if (numOfFisherman >= 7 && numOfFisherman <= 11)
- {
- discount = rent * 0.15;
- rent = rent - discount;
- }
- else if (numOfFisherman >= 12)
- {
- discount = rent * 0.25;
- rent = rent - discount;
- }
- }
- if (sezone=="Summer" ||sezone=="Autumn" )
- {
- rent = 4200;
- if (numOfFisherman<=6)
- {
- discount = rent * 0.1;
- rent = rent - discount;
- }
- else if (numOfFisherman>=7 && numOfFisherman<=11)
- {
- discount = rent * 0.15;
- rent = rent - discount;
- }
- else if (numOfFisherman>=12)
- {
- discount = rent * 0.25;
- rent = rent - discount;
- }
- }
- if (sezone== "Winter")
- {
- rent = 2600;
- if (numOfFisherman <= 6)
- {
- discount = rent * 0.1;
- rent = rent - discount;
- }
- else if (numOfFisherman >= 7 && numOfFisherman <= 11)
- {
- discount = rent * 0.15;
- rent = rent - discount;
- }
- else if (numOfFisherman >= 12)
- {
- discount = rent * 0.25;
- rent = rent - discount;
- }
- if (numOfFisherman %2==0 )
- {
- double extraDiscount = rent * 0.5;
- rent = rent - extraDiscount;
- if (sezone == "Summer" || sezone == "Winter" || sezone == "Spring")
- {
- rent = rent - extraDiscount;
- }
- }
- // tuka mislq che trqbva da e chetnata proverka
- // if (sezone== "Autumn")
- // {
- // rent = 4200;
- // if (numOfFisherman <= 6)
- // {
- // discount = rent * 0.1;
- // rent = rent - discount;
- // }
- // else if (numOfFisherman >= 7 && numOfFisherman <= 11)
- // {
- // discount = rent * 0.15;
- // rent = rent - discount;
- // }
- // else if (numOfFisherman >= 12)
- // {
- // discount = rent * 0.25;
- // rent = rent - discount;
- // }
- //}
- }
- if (budget>=rent)
- {
- double leftMoney = budget - rent;
- Console.WriteLine($"Yes! You have {leftMoney:F2} leva left.");
- }
- else if (budget<=rent)
- {
- double leftMoney = rent - budget;
- Console.WriteLine($"Not enough money! You need {leftMoney:F2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement