/**
 * This function calculates the discount for a fashion item based on its type and price.
 *
 * The discounts are as follows:
 * - If the item is a top and the price is greater than 1000, the discount is 20%.
 * - If the item is a bottom and the price is between 500 and 1000, the discount is 15%.
 * - If the item is an accessory and the price is less than 500, the discount is 10%.
 * - For any other combination, there is no discount applied.
 *
 * @param itemType The type of the fashion item.
 * @param price The price of the fashion item.
 * @return The calculated discount for the fashion item.
 */
fun calculateDiscount(itemType: String, price: Double): Double {

    var discount = 0.0

    when (itemType) {
        "top" -> {
            if (price > 1000) {
                discount = 20.0
            }
        }
        "bottom" -> {
            if (price in 501.0..1000.0) {
                discount = 15.0
            }
        }
        "accessory" -> {
            if (price < 500) {
                discount = 10.0
            }
        }
    }

    return discount
}
/**
 * This function calculates the discount for a fashion item based on its type and price.
 *
 * The discounts are as follows:
 * - If the item is a top and the price is greater than 1000, the discount is 20%.
 * - If the item is a bottom and the price is between 500 and 1000, the discount is 15%.
 * - If the item is an accessory and the price is less than 500, the discount is 10%.
 * - For any other combination, there is no discount applied.
 *
 * @param itemType The type of the fashion item.
 * @param price The price of the fashion item.
 * @return The calculated discount for the fashion item.
 */
fun calculateDiscount(itemType: String, price: Double): Double {
/**
 * This function calculates the discount for a fashion item based on its type and price.
 *
 * The discounts are as follows:
 * - If the item is a top and the price is greater than 1000, the discount is 20%.
 * - If the item is a bottom and the price is between 500 and 1000, the discount is 15%.
 * - If the item is an accessory and the price is less than 500, the discount is 10%.
 * - For any other combination, there is no discount applied.
 *
 * @param itemType The type of the fashion item.
 * @param price The price of the fashion item.
 * @return The calculated discount for the fashion item.
 */
fun calculateDiscount(itemType: String, price: Double): Double {

    var discount = 0.0

    when (itemType) {
        "top" -> {
            if (price > 1000) {
                discount = 20.0
            }
        }
        "bottom" -> {
            if (price in 501.0..1000.0) {
                discount = 15.0
            }
        }
        "accessory" -> {
            if (price < 500) {
                discount = 10.0
            }
        }
    }

    return discount
}