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