Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Computer_Room
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine(); //march", "april", "may", "june", "july", "august
- double CountDaysSpend = double.Parse(Console.ReadLine());
- double CountPeopleInGroup = double.Parse(Console.ReadLine());
- string TimeOfDay = Console.ReadLine(); // day", "night
- double price = 0;
- double TotalMoney = 0;
- switch (month)
- {
- case "march":
- if (TimeOfDay == "day")
- {
- price = 10.50;
- }
- else if (TimeOfDay == "night")
- {
- price = 8.40;
- }
- TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
- break;
- case "april":
- if (TimeOfDay == "day")
- {
- price = 10.50;
- }
- else if (TimeOfDay == "night")
- {
- price = 8.40;
- }
- TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
- break;
- case "may":
- if (TimeOfDay == "day")
- {
- price = 10.50;
- }
- else if (TimeOfDay == "night")
- {
- price = 8.40;
- }
- TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
- break;
- case "june":
- if (TimeOfDay == "day")
- {
- price = 12.60;
- }
- else if (TimeOfDay == "night")
- {
- price = 10.20;
- }
- break;
- case "july":
- if (TimeOfDay == "day")
- {
- price = 12.60;
- }
- else if (TimeOfDay == "night")
- {
- price = 10.20;
- price = CountPeopleInGroup - (CountPeopleInGroup * 0.10);
- price = price - (CountDaysSpend * 0.50);
- }
- TotalMoney = (price * CountPeopleInGroup) * CountDaysSpend;
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
- break;
- case "august":
- if (TimeOfDay == "day")
- {
- price = 12.60;
- }
- else if (TimeOfDay == "night")
- {
- price = 10.20;
- }
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement