Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01.Sandbox
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine().ToLower();
- int hours = int.Parse(Console.ReadLine());
- int people = int.Parse(Console.ReadLine());
- string period = Console.ReadLine().ToLower();
- double price = 0;
- if ((month == "january" || month == "february" || month == "march" || month == "april" || month == "may") && period == "day")
- {
- price = 10.50;
- }
- else if ((month == "january" || month == "february" || month == "march" || month == "april" || month == "may") && period == "night")
- {
- price = 8.40;
- }
- else if ((month == "june" || month == "july" || month == "august" || month == "september" || month == "october" || month == "november" || month == "december") && period == "day")
- {
- price = 12.60;
- }
- else
- {
- price = 10.20;
- }
- if(people >= 4)
- {
- price = price * 0.90;
- }
- if(hours >= 5)
- {
- price = price * 0.5;
- }
- var totalSum = (price * people) * hours;
- Console.Write("Price per person for one hour: ");
- Console.Write("{0:f2}", price);
- Console.WriteLine();
- Console.Write("Total cost of the visit: ");
- Console.Write("{0:f2}", totalSum);
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement