Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ComputerRoom
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int hours = int.Parse(Console.ReadLine());
- int people = int.Parse(Console.ReadLine());
- string time = Console.ReadLine();
- double price = 0;
- if (month == "march" || month == "april" || month == "may")
- {
- if (time == "day")
- {
- price = 10.50;
- hours = 3;
- }
- else
- {
- price = 8.40;
- }
- }
- else if (month == "june" || month == "july" || month == "august")
- {
- if (time == "day")
- {
- price = 12.60;
- }
- else
- {
- price = 10.20;
- }
- }
- if (people >= 4)
- {
- price *= 0.9;
- }
- if (hours >= 5)
- {
- price /= 2;
- }
- double total = price * people * hours;
- Console.WriteLine($"Price per person for one hour: {price:f2}");
- Console.WriteLine($"Total cost of the visit: {total:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement