/**
 * Calculate the discount for a customer based on their total sales and whether they are a new customer or not.
 * If the total sales are greater than $5000 and they are a new customer, apply a discount of 10%.
 * If the total sales are greater than $5000 and they are not a new customer, apply a discount of 5%.
 * If the total sales are not greater than $5000, apply a discount of 2% regardless of it being a new or existing customer.
 */
fun calculateDiscount(totalSales: Double, newCustomer: Boolean): Int {

    return if (totalSales > 5000) {
        if (newCustomer) {
            10
        } else {
            5
        }
    } else {
        2
    }
}
/**
 * Calculate the discount for a customer based on their total sales and whether they are a new customer or not.
 * If the total sales are greater than $5000 and they are a new customer, apply a discount of 10%.
 * If the total sales are greater than $5000 and they are not a new customer, apply a discount of 5%.
 * If the total sales are not greater than $5000, apply a discount of 2% regardless of it being a new or existing customer.
 */
fun calculateDiscount(totalSales: Double, newCustomer: Boolean): Int {
/**
 * Calculate the discount for a customer based on their total sales and whether they are a new customer or not.
 * If the total sales are greater than $5000 and they are a new customer, apply a discount of 10%.
 * If the total sales are greater than $5000 and they are not a new customer, apply a discount of 5%.
 * If the total sales are not greater than $5000, apply a discount of 2% regardless of it being a new or existing customer.
 */
fun calculateDiscount(totalSales: Double, newCustomer: Boolean): Int {

    return if (totalSales > 5000) {
        if (newCustomer) {
            10
        } else {
            5
        }
    } else {
        2
    }
}