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