/**
 * You are a fashion designer and you want to calculate your daily profit based on your sales.
 * You have a target number of sales, the current number of sales, and the price per item.
 * Your task is to complete the while loop to calculate the daily profit until the target is reached.
 *
 * @param targetSales The desired number of sales.
 * @param currentSales The current number of sales.
 * @param pricePerItem The price per item sold.
 * @return The daily profit.
 */
fun calculateDailyProfit(targetSales: Int, currentSales: Int, pricePerItem: Double): Double {

    var totalProfit = 0.0

    // Calculate the daily profit while the current sales is less than the target sales
    var sales = currentSales
    while (sales < targetSales) {
        val remainingSales = targetSales - sales
        val itemsSold = if (remainingSales >= sales) {
            sales * pricePerItem
        } else {
            remainingSales * pricePerItem
        }

        totalProfit += itemsSold
        sales++
    }

    return totalProfit
}

// Example usage
val targetSales = 100
val currentSales = 0
val pricePerItem = 50.0
/**
 * You are a fashion designer and you want to calculate your daily profit based on your sales.
 * You have a target number of sales, the current number of sales, and the price per item.
 * Your task is to complete the while loop to calculate the daily profit until the target is reached.
 *
 * @param targetSales The desired number of sales.
 * @param currentSales The current number of sales.
 * @param pricePerItem The price per item sold.
 * @return The daily profit.
 */
fun calculateDailyProfit(targetSales: Int, currentSales: Int, pricePerItem: Double): Double {
/**
 * You are a fashion designer and you want to calculate your daily profit based on your sales.
 * You have a target number of sales, the current number of sales, and the price per item.
 * Your task is to complete the while loop to calculate the daily profit until the target is reached.
 *
 * @param targetSales The desired number of sales.
 * @param currentSales The current number of sales.
 * @param pricePerItem The price per item sold.
 * @return The daily profit.
 */
fun calculateDailyProfit(targetSales: Int, currentSales: Int, pricePerItem: Double): Double {

    var totalProfit = 0.0

    // Calculate the daily profit while the current sales is less than the target sales
    var sales = currentSales
    while (sales < targetSales) {
        val remainingSales = targetSales - sales
        val itemsSold = if (remainingSales >= sales) {
            sales * pricePerItem
        } else {
            remainingSales * pricePerItem
        }

        totalProfit += itemsSold
        sales++
    }

    return totalProfit
}

// Example usage
val targetSales = 100
val currentSales = 0
val pricePerItem = 50.0