/**
 * This function calculates the total price of the products given their quantities and prices.
 *
 * @param products A list containing the names of the products.
 * @param prices A list containing the prices of the products.
 * @return The total price of all the products.
 */
fun calculateTotalPrice(products: List<String>, prices: List<Double>): Double {

    var totalPrice = 0.0

    for (i in products.indices) {
        print("Enter the quantity of ${products[i]}: ")
        val quantity = readLine()!!.toInt()

        var subTotal = 0.0

        repeat(quantity) {
            subTotal += prices[i]
        }

        totalPrice += subTotal
    }

    return totalPrice
}

// Example usage
/**
 * This function calculates the total price of the products given their quantities and prices.
 *
 * @param products A list containing the names of the products.
 * @param prices A list containing the prices of the products.
 * @return The total price of all the products.
 */
fun calculateTotalPrice(products: List<String>, prices: List<Double>): Double {
/**
 * This function calculates the total price of the products given their quantities and prices.
 *
 * @param products A list containing the names of the products.
 * @param prices A list containing the prices of the products.
 * @return The total price of all the products.
 */
fun calculateTotalPrice(products: List<String>, prices: List<Double>): Double {

    var totalPrice = 0.0

    for (i in products.indices) {
        print("Enter the quantity of ${products[i]}: ")
        val quantity = readLine()!!.toInt()

        var subTotal = 0.0

        repeat(quantity) {
            subTotal += prices[i]
        }

        totalPrice += subTotal
    }

    return totalPrice
}

// Example usage