Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace kiki2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double buget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- double count = double.Parse(Console.ReadLine());
- double boatPrice = 0;
- double totalBoatPrice = 0;
- double moneyLeft = 0;
- double moneyNeed = 0;
- if (season == "Spring")
- {
- boatPrice = 3000;
- }
- else if (season=="Summer"||season=="Autumn")
- {
- boatPrice = 4200;
- }
- else if (season=="Winter")
- {
- boatPrice = 2600;
- }
- if (count<=6)
- {
- totalBoatPrice =boatPrice* 0.90;
- }
- else if (count>=7 && count <=11)
- {
- totalBoatPrice =boatPrice* 0.85;
- }
- else if (count >12)
- {
- totalBoatPrice =boatPrice* 0.75;
- }
- if ((count % 2 == 0) && (season == "Spring" || season == "Summer" || season == "Winter"))
- {
- totalBoatPrice = totalBoatPrice * 0.95;
- }
- if (buget>=totalBoatPrice)
- {
- moneyLeft = buget - totalBoatPrice;
- Console.WriteLine($" Yes! You have {moneyLeft:f2} leva left.");
- }
- else if (buget<=boatPrice)
- {
- moneyNeed = totalBoatPrice - buget;
- Console.WriteLine($" Not enough money! You need {moneyNeed:f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment