Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Reservation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int reservationDay = int.Parse(Console.ReadLine());
- int reservationMonth = int.Parse(Console.ReadLine());
- int accommodationDay = int.Parse(Console.ReadLine());
- int accommodationMonth = int.Parse(Console.ReadLine());
- int leavingDay = int.Parse(Console.ReadLine());
- int leavingMonth = int.Parse(Console.ReadLine());
- double price = 0;
- double priceForRoom = 0;
- double days = leavingDay - accommodationDay;
- if (accommodationMonth == reservationMonth)
- {
- if (accommodationDay - reservationDay < 10)
- {
- priceForRoom = 30;
- price = days * priceForRoom;
- }
- else
- {
- priceForRoom = 25;
- price = days * priceForRoom;
- }
- }
- else if (accommodationMonth - reservationMonth == 1)
- {
- priceForRoom = 25;
- price = (days * priceForRoom) - (days * priceForRoom * 0.20);
- }
- Console.WriteLine($"Your stay from {accommodationDay}/{accommodationMonth} to {leavingDay}/{leavingMonth} will cost {price:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment