Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FishingBoat
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishermen = int.Parse(Console.ReadLine());
- double boatPrice = 0;
- double promo = 0;
- switch (season)
- {
- case "Spring":
- boatPrice = 3000;
- break;
- case "Summer":
- case "Autumn":
- boatPrice = 4200;
- break;
- case "Winter":
- boatPrice = 2600;
- break;
- }
- if (fishermen <= 6)
- {
- promo = 0.1;
- }
- else if (fishermen >= 7 && fishermen <= 11)
- {
- promo = 0.15;
- }
- else if(fishermen >= 12)
- {
- promo = 0.25;
- }
- if((season == "Winter" || season == "Spring" || season == "Summer") && fishermen % 2 == 0) {
- promo += 0.05;
- }
- //Console.WriteLine(promo);
- //Console.WriteLine(boatPrice);
- double sum = boatPrice - (boatPrice * promo);
- if (budget >= sum)
- {
- Console.WriteLine($"Yes! You have {(budget - sum):f2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {(sum - budget):f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement