Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp13
- {
- public class Program
- {
- static void Main()
- {
- decimal numberOfPeople = int.Parse(Console.ReadLine());
- string typeOfGroup = Console.ReadLine();
- string dayOfTheWeek = Console.ReadLine();
- decimal pricePerNight = 0;
- // Calculating the price per night dependind on the day of the week and the type of the group
- if (typeOfGroup == "Students" && dayOfTheWeek == "Friday")
- pricePerNight = 8.45m;
- if (typeOfGroup == "Business" && dayOfTheWeek == "Friday")
- pricePerNight = 10.90m;
- if (typeOfGroup == "Regular" && dayOfTheWeek == "Friday")
- pricePerNight = 15.00m;
- if (typeOfGroup == "Students" && dayOfTheWeek == "Saturday")
- pricePerNight = 9.80m;
- if (typeOfGroup == "Business" && dayOfTheWeek == "Saturday")
- pricePerNight = 15.60m;
- if (typeOfGroup == "Regular" && dayOfTheWeek == "Saturday")
- pricePerNight = 20.00m;
- if (typeOfGroup == "Students" && dayOfTheWeek == "Sunday")
- pricePerNight = 10.46m;
- if (typeOfGroup == "Business" && dayOfTheWeek == "Sunday")
- pricePerNight = 16.00m;
- if (typeOfGroup == "Regular" && dayOfTheWeek == "Sunday")
- pricePerNight = 22.50m;
- decimal totalPrice = pricePerNight * numberOfPeople;
- // Discounts
- decimal discount = 0;
- if (typeOfGroup == "Students" && numberOfPeople >= 30)
- {
- discount = (totalPrice / 100) * 15;
- totalPrice -= discount;
- }
- if (typeOfGroup == "Business" && numberOfPeople >= 100)
- {
- totalPrice = totalPrice - pricePerNight * 10;
- }
- if (typeOfGroup == "Regular" && numberOfPeople >= 10 && numberOfPeople < 21)
- {
- discount = (totalPrice / 100) * 5;
- totalPrice -= discount;
- }
- Console.WriteLine($"Total price: {Math.Round(totalPrice, 2)}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment