Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int nightStays = int.Parse(Console.ReadLine());
- double pricePerNight = double.Parse(Console.ReadLine());
- int percenteExp = int.Parse(Console.ReadLine());
- if (nightStays > 7)
- {
- pricePerNight *= 0.95;
- }
- double stayPrice = (nightStays * pricePerNight) + budget * (percenteExp / 100.0);
- if (stayPrice <= budget)
- {
- Console.WriteLine($"Ivanovi will be left with {budget - stayPrice:f2} leva after vacation.");
- }
- else
- {
- Console.WriteLine($"{stayPrice - budget:f2} leva needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement