Untitled
unknown
plain_text
a year ago
1.2 kB
6
Indexable
using System; class Program { static void Main() { Console.Write("Enter the type of the movie (Premiere/Normal/Discount): "); string movieType = Console.ReadLine(); Console.Write("Enter the count of rows: "); int rowCount = int.Parse(Console.ReadLine()); Console.Write("Enter the count of seats per row: "); int seatCountPerRow = int.Parse(Console.ReadLine()); double ticketPrice; switch (movieType.ToLower()) // Convert to lowercase to handle case-insensitivity { case "premiere": ticketPrice = 12.00; break; case "normal": ticketPrice = 7.50; break; case "discount": ticketPrice = 5.00; break; default: Console.WriteLine("Invalid movie type. Please enter Premiere, Normal, or Discount."); return; } int totalSeats = rowCount * seatCountPerRow; double totalPrice = totalSeats * ticketPrice; Console.WriteLine($"Total price for {totalSeats} seats: ${totalPrice:F2}"); } }
Editor is loading...