Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var month = Console.ReadLine().ToLower();
- var hours = int.Parse(Console.ReadLine());
- var groupNumber = int.Parse(Console.ReadLine());
- var timeDay = Console.ReadLine().ToLower(); //"day" , "night
- double price = 0;
- if (timeDay == "day")
- {
- if (month == "march" || month == "april" || month == "may")
- {
- price = 10.50; // day March - May
- }
- else if (month == "june" || month == "july" || month == "august")
- {
- price = 12.60; // day June - August
- }
- else
- {
- Console.WriteLine("ERROR");
- }
- }
- else
- {
- if (month == "march" || month == "april" || month == "may")
- {
- price = 8.40; // night March - May
- }
- else if (month == "june" || month == "july" || month == "august")
- {
- price = 10.20; // night June - August
- }
- else
- {
- Console.WriteLine("ERROR");
- }
- }
- var totalPrice = price * hours * groupNumber;
- if (groupNumber >= 4)
- {
- totalPrice = totalPrice - (totalPrice * 0.10); // -10%
- price = price - (price * 0.10); // -10%
- }
- if (hours >= 5)
- {
- totalPrice = totalPrice - (totalPrice * 0.50); // -50%
- price = price - (price * 0.50); // -50%
- }
- Console.WriteLine($"Price per person for one hour: {price:f2}"); // per person
- Console.WriteLine($"Total cost of the visit: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement