/**
 * A fashion designer wants to calculate the total cost of a list of items
 * after applying a discount percentage.
 *
 * Complete the function below, which takes a list of item prices and a
 * discount percentage as parameters, and returns the total cost after discount.
 *
 * @param items A list of floating-point values representing the prices of items.
 * @param discount A floating-point value representing the discount percentage.
 * @return The total cost after applying the discount percentage.
 *
 * Example:
 * items = [9.99, 19.99, 29.99]
 * discount = 0.15
 * calculateTotalCost(items, discount) -> 46.53
 */
fun calculateTotalCost(items: List<Double>, discount: Double): Double {

    var totalCost = 0.0

    for (price in items) {
        totalCost += price
    }

    totalCost -= totalCost * discount

    return totalCost
}
/**
 * A fashion designer wants to calculate the total cost of a list of items
 * after applying a discount percentage.
 *
 * Complete the function below, which takes a list of item prices and a
 * discount percentage as parameters, and returns the total cost after discount.
 *
 * @param items A list of floating-point values representing the prices of items.
 * @param discount A floating-point value representing the discount percentage.
 * @return The total cost after applying the discount percentage.
 *
 * Example:
 * items = [9.99, 19.99, 29.99]
 * discount = 0.15
 * calculateTotalCost(items, discount) -> 46.53
 */
fun calculateTotalCost(items: List<Double>, discount: Double): Double {
/**
 * A fashion designer wants to calculate the total cost of a list of items
 * after applying a discount percentage.
 *
 * Complete the function below, which takes a list of item prices and a
 * discount percentage as parameters, and returns the total cost after discount.
 *
 * @param items A list of floating-point values representing the prices of items.
 * @param discount A floating-point value representing the discount percentage.
 * @return The total cost after applying the discount percentage.
 *
 * Example:
 * items = [9.99, 19.99, 29.99]
 * discount = 0.15
 * calculateTotalCost(items, discount) -> 46.53
 */
fun calculateTotalCost(items: List<Double>, discount: Double): Double {

    var totalCost = 0.0

    for (price in items) {
        totalCost += price
    }

    totalCost -= totalCost * discount

    return totalCost
}