/**
 * Calculate the total price of selected items based on their individual prices and quantity.
 *
 * @param selectedItems A set of tuples containing item name, price, and quantity.
 * @return The total price of all selected items.
 *
 * Instructions:
 * - Use loops to iterate over the selectedItems set.
 * - Each selected item is represented as a tuple containing item name, price, and quantity.
 * - Calculate the total price of each item by multiplying its price with its quantity.
 * - Finally, sum up the prices of all selected items and return the total price.
 *
 * Example:
 * val selectedItems = setOf(Triple("Chair", 50.0, 2), Triple("Table", 100.0, 1), Triple("Lamp", 80.0, 3))
 * calculatePrice(selectedItems) -> 470.0
 */
fun calculatePrice(selectedItems: Set<Triple<String, Double, Int>>): Double {

    var totalPrice = 0.0
    
    for (item in selectedItems) {
        val (itemName, itemPrice, itemQty) = item  // Unpacking the item tuple
        
        val itemTotalPrice = itemPrice * itemQty
        totalPrice += itemTotalPrice
    }
    
    return totalPrice
}
/**
 * Calculate the total price of selected items based on their individual prices and quantity.
 *
 * @param selectedItems A set of tuples containing item name, price, and quantity.
 * @return The total price of all selected items.
 *
 * Instructions:
 * - Use loops to iterate over the selectedItems set.
 * - Each selected item is represented as a tuple containing item name, price, and quantity.
 * - Calculate the total price of each item by multiplying its price with its quantity.
 * - Finally, sum up the prices of all selected items and return the total price.
 *
 * Example:
 * val selectedItems = setOf(Triple("Chair", 50.0, 2), Triple("Table", 100.0, 1), Triple("Lamp", 80.0, 3))
 * calculatePrice(selectedItems) -> 470.0
 */
fun calculatePrice(selectedItems: Set<Triple<String, Double, Int>>): Double {
/**
 * Calculate the total price of selected items based on their individual prices and quantity.
 *
 * @param selectedItems A set of tuples containing item name, price, and quantity.
 * @return The total price of all selected items.
 *
 * Instructions:
 * - Use loops to iterate over the selectedItems set.
 * - Each selected item is represented as a tuple containing item name, price, and quantity.
 * - Calculate the total price of each item by multiplying its price with its quantity.
 * - Finally, sum up the prices of all selected items and return the total price.
 *
 * Example:
 * val selectedItems = setOf(Triple("Chair", 50.0, 2), Triple("Table", 100.0, 1), Triple("Lamp", 80.0, 3))
 * calculatePrice(selectedItems) -> 470.0
 */
fun calculatePrice(selectedItems: Set<Triple<String, Double, Int>>): Double {

    var totalPrice = 0.0
    
    for (item in selectedItems) {
        val (itemName, itemPrice, itemQty) = item  // Unpacking the item tuple
        
        val itemTotalPrice = itemPrice * itemQty
        totalPrice += itemTotalPrice
    }
    
    return totalPrice
}