/**
 * You are an interior designer who needs to calculate the total cost of items for a project.
 * You have a list of items and their corresponding prices.
 * Your task is to calculate the total cost by multiplying the prices of each item with a given quantity.
 *
 * @param items A list of items (String)
 * @param prices A list of prices (Double)
 * @return The total cost (Double)
 */
fun calculateTotalCost(items: List<String>, prices: List<Double>): Double {

    var totalCost = 0.0  // initialize the total cost variable

    for ((index, item) in items.withIndex()) {
        print("How many ${item}s do you need? ")
        val quantity = readLine()?.toIntOrNull() ?: 0  // prompt the user for the quantity

        // multiply the price by the quantity and assign it to the totalCost variable
        totalCost += prices[index] * quantity
    }

    return totalCost
}
/**
 * You are an interior designer who needs to calculate the total cost of items for a project.
 * You have a list of items and their corresponding prices.
 * Your task is to calculate the total cost by multiplying the prices of each item with a given quantity.
 *
 * @param items A list of items (String)
 * @param prices A list of prices (Double)
 * @return The total cost (Double)
 */
fun calculateTotalCost(items: List<String>, prices: List<Double>): Double {
/**
 * You are an interior designer who needs to calculate the total cost of items for a project.
 * You have a list of items and their corresponding prices.
 * Your task is to calculate the total cost by multiplying the prices of each item with a given quantity.
 *
 * @param items A list of items (String)
 * @param prices A list of prices (Double)
 * @return The total cost (Double)
 */
fun calculateTotalCost(items: List<String>, prices: List<Double>): Double {

    var totalCost = 0.0  // initialize the total cost variable

    for ((index, item) in items.withIndex()) {
        print("How many ${item}s do you need? ")
        val quantity = readLine()?.toIntOrNull() ?: 0  // prompt the user for the quantity

        // multiply the price by the quantity and assign it to the totalCost variable
        totalCost += prices[index] * quantity
    }

    return totalCost
}