namespace KinoGigant { public class Program { // Create a new show catalog public static ShowCatalog catalog = new ShowCatalog(); public static void Main(string[] args) { // Populate the catalog with sample shows catalog.SeedSampleShows(); while (true) { Console.WriteLine("=== Cinema Reservation System ==="); Console.WriteLine("1. Display all shows"); Console.WriteLine("2. Add a new show"); Console.WriteLine("3. Exit"); Console.Write("Choose an option: "); string choice = Console.ReadLine(); Console.WriteLine(); switch (choice) { case "1": DisplayShows(); break; case "2": AddShow(); break; case "3": Console.WriteLine("Exiting the application..."); return; default: Console.WriteLine("Invalid option. Please try again."); break; } Console.WriteLine(); } } static void AddShow() { Console.Write("Add title: "); string title = Console.ReadLine(); Console.Write("Enter the show date (yyyy-MM-dd): "); string dateInput = Console.ReadLine(); // Parse date only if (!DateTime.TryParse(dateInput, out DateTime showDate)) { Console.WriteLine("Invalid date format."); return; } Console.Write("Enter the show time (HH:mm): "); string timeInput = Console.ReadLine(); // Parse time only if (!DateTime.TryParse(timeInput, out DateTime tempDateTime)) { Console.WriteLine("Invalid time format."); return; } // Combine the show date with the parsed time DateTime showHour = new DateTime( showDate.Year, showDate.Month, showDate.Day, tempDateTime.Hour, tempDateTime.Minute, 0 ); Console.Write("Enter the number of seats: "); if (!int.TryParse(Console.ReadLine(), out int numberOfSeats) || numberOfSeats <= 0) { Console.WriteLine("Invalid number of seats. Show not added."); return; } // Create a new Show and add it to the list catalog.Add(new Show(title, showDate, showHour, numberOfSeats)); Console.WriteLine("New show added successfully!"); } static void DisplayShows() { foreach (var show in catalog.Shows) { Console.WriteLine($"{show.Title} - {show.ShowDate.ToShortDateString()} {show.ShowHour.ToShortTimeString()}"); } } } }