/**
 * A fashion designer needs to calculate the total expenses for a collection.
 * The designer's salary, the price of each material, the number of materials used, and
 * the discount percentage are given. Complete the function to calculate the total expenses,
 * considering the designer's salary and the quantity and price of materials used.
 * Apply the discount to the total expenses at the end of the calculation.
 */
fun calculateTotalExpenses(salary: Double, pricePerMaterial: Double, numMaterials: Int, discountPercentage: Double): Double {

    val totalMaterialsCost = pricePerMaterial * numMaterials
    var totalExpenses = totalMaterialsCost + salary

    // Subtract the discount from the total expenses
    totalExpenses -= totalExpenses * (discountPercentage / 100)

    return totalExpenses
}
/**
 * A fashion designer needs to calculate the total expenses for a collection.
 * The designer's salary, the price of each material, the number of materials used, and
 * the discount percentage are given. Complete the function to calculate the total expenses,
 * considering the designer's salary and the quantity and price of materials used.
 * Apply the discount to the total expenses at the end of the calculation.
 */
fun calculateTotalExpenses(salary: Double, pricePerMaterial: Double, numMaterials: Int, discountPercentage: Double): Double {
/**
 * A fashion designer needs to calculate the total expenses for a collection.
 * The designer's salary, the price of each material, the number of materials used, and
 * the discount percentage are given. Complete the function to calculate the total expenses,
 * considering the designer's salary and the quantity and price of materials used.
 * Apply the discount to the total expenses at the end of the calculation.
 */
fun calculateTotalExpenses(salary: Double, pricePerMaterial: Double, numMaterials: Int, discountPercentage: Double): Double {

    val totalMaterialsCost = pricePerMaterial * numMaterials
    var totalExpenses = totalMaterialsCost + salary

    // Subtract the discount from the total expenses
    totalExpenses -= totalExpenses * (discountPercentage / 100)

    return totalExpenses
}