/* Alex, Sam, and Jamie are organizing a concert and need a Dart program to help them track ticket sales. They want to: Set Ticket Prices: Declare the price per ticket and set an initial number of sold tickets. Calculate Revenue: Calculate the total revenue and display it using string interpolation. Track Age Group: Depending on the customer's age, they want to print a message offering discounts to seniors (60+) and children (under 12). Loop through Ticket Sales: Use a loop to simulate ticket sales until they reach the target of 200 tickets. Ternary Operator for Late Fee: Add a late fee if the total tickets are sold after a certain hour, using a ternary operator. */ import 'dart:io'; void main(){ // set ticket prices double pricePerTicket = double.parse(stdin.readLineSync()!); int ticketsSold = int.parse(stdin.readLineSync()!); // calculate revenue double totalRevenue = (ticketsSold * pricePerTicket).toDouble(); print("Total revenue: $totalRevenue"); // track age group int age = int.parse(stdin.readLineSync()!); if(age >= 60){ print("Senior discount applied!"); } else if(age <= 12){ print("Child discount applied!"); } else { print("No discount applied!"); } // loop through ticket sales ticketsSold = 0; while(ticketsSold < 200){ int soldHour = int.parse(stdin.readLineSync()!); ticketsSold += soldHour; print("Tickets sold: $ticketsSold"); } // ternary operator for late fee String isLateResponse = stdin.readLineSync()!; bool isLate = (isLateResponse == "y") ? true : false; totalRevenue = totalRevenue + (isLate ? 0: 50); print("Total revenue with late fee: $totalRevenue"); }