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 _06
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishers = int.Parse(Console.ReadLine());
- double boatPrice = 0.0;
- double discount = 0.0;
- double totalPrice = 0.0;
- switch (season)
- {
- case "Spring":
- boatPrice = 3000;
- break;
- case "Summer":
- case "Autumn":
- boatPrice = 4200;
- break;
- case "Winter":
- boatPrice = 2600;
- break;
- default:
- break;
- }
- if (fishers <= 6)
- {
- discount = boatPrice * 10 / 100;
- }
- else if (fishers >= 7 && fishers <= 11)
- {
- discount = boatPrice * 15 / 100;
- }
- else if (fishers >= 12)
- {
- discount = boatPrice * 25 / 100;
- }
- if (fishers % 2 == 0 && season != "Autumn")
- {
- discount = discount + boatPrice * 5 / 100;
- }
- totalPrice = boatPrice - discount;
- if (budget >= totalPrice)
- {
- double moneyLeft = budget - totalPrice;
- Console.WriteLine("Yes! You have {0:F2} leva left.", moneyLeft);
- }
- else
- {
- double moneyNeeded = totalPrice - budget;
- Console.WriteLine("Not enough money! You need {0:F2} leva.", moneyNeeded);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement