Challenge 2: A Simple Menu DSL — Solution class Menu { private val items = mutableListOf() fun item(name: String, price: Double) { items.add("$name — $price") } fun printMenu() { items.forEach { println(it) } } } fun menu(init: Menu.() -> Unit): Menu { val m = Menu() m.init() return m } fun main() { val dinnerMenu = menu { item("Margherita Pizza", 12.50) item("Caesar Salad", 8.00) item("Tiramisu", 6.50) } dinnerMenu.printMenu() } /* Output: Margherita Pizza — 12.5 Caesar Salad — 8.0 Tiramisu — 6.5 Notes: - menu(init: Menu.() -> Unit) follows the exact same shape as the chapter's html(init: Html.() -> Unit) — create the object, run the lambda against it as receiver, return the object. - Inside the menu { } block, item(...) is callable directly with no prefix, since the lambda's implicit receiver is the Menu instance being built. - Each item(...) call appends one formatted string to the Menu's private items list, later printed by printMenu(). */