/**
 * Given the customer type and the purchase amount, calculate the discount applicable.
 *
 * @param customer Customer type - 'Regular' or 'VIP'.
 * @param purchaseAmount Total purchase amount.
 * @return Discount amount based on the customer type and purchase amount.
 */
fun calculateDiscount(customer: String, purchaseAmount: Double): Double {

    // Get the applicable discount percentage based on the customer type
    val discountPercentage = when (customer) {
        "Regular" -> 0.1 // Regular customer gets 10% discount
        "VIP" -> 0.2 // VIP customer gets 20% discount
        else -> 0.0 // No discount if customer type is not recognized
    }

    // Calculate the discount amount
    val discountAmount = purchaseAmount * discountPercentage

    return discountAmount
}
/**
 * Given the customer type and the purchase amount, calculate the discount applicable.
 *
 * @param customer Customer type - 'Regular' or 'VIP'.
 * @param purchaseAmount Total purchase amount.
 * @return Discount amount based on the customer type and purchase amount.
 */
fun calculateDiscount(customer: String, purchaseAmount: Double): Double {
/**
 * Given the customer type and the purchase amount, calculate the discount applicable.
 *
 * @param customer Customer type - 'Regular' or 'VIP'.
 * @param purchaseAmount Total purchase amount.
 * @return Discount amount based on the customer type and purchase amount.
 */
fun calculateDiscount(customer: String, purchaseAmount: Double): Double {

    // Get the applicable discount percentage based on the customer type
    val discountPercentage = when (customer) {
        "Regular" -> 0.1 // Regular customer gets 10% discount
        "VIP" -> 0.2 // VIP customer gets 20% discount
        else -> 0.0 // No discount if customer type is not recognized
    }

    // Calculate the discount amount
    val discountAmount = purchaseAmount * discountPercentage

    return discountAmount
}