/**
 * A zoologist is studying a group of animals and wants to calculate the total weight of all the animals.
 * Given a dictionary where the keys are the names of the animals and the values are their respective weights,
 * write a program to calculate the total weight by using the multiplication assignment operator.
 *
 * Example:
 * val weightDict = mapOf("lion" to 150, "elephant" to 3000, "giraffe" to 800, "rhino" to 2000)
 * var totalWeight = 0
 *
 * Implement your code to iterate through each animal and accumulate its weight to the totalWeight variable.
 *
 * Hint: Use the multiplication assignment operator (*=) to multiply the weight of each animal with a factor.
 */
fun calculateTotalWeight(weightDict: Map<String, Int>): Int {

    var totalWeight = 0
    val factor = 1

    // Iterate through each animal's weight
    for ((animal, weight) in weightDict) {
        // Accumulate the weight to the totalWeight variable using the multiplication assignment operator
        totalWeight += weight * factor
    }

    return totalWeight
}
/**
 * A zoologist is studying a group of animals and wants to calculate the total weight of all the animals.
 * Given a dictionary where the keys are the names of the animals and the values are their respective weights,
 * write a program to calculate the total weight by using the multiplication assignment operator.
 *
 * Example:
 * val weightDict = mapOf("lion" to 150, "elephant" to 3000, "giraffe" to 800, "rhino" to 2000)
 * var totalWeight = 0
 *
 * Implement your code to iterate through each animal and accumulate its weight to the totalWeight variable.
 *
 * Hint: Use the multiplication assignment operator (*=) to multiply the weight of each animal with a factor.
 */
fun calculateTotalWeight(weightDict: Map<String, Int>): Int {
/**
 * A zoologist is studying a group of animals and wants to calculate the total weight of all the animals.
 * Given a dictionary where the keys are the names of the animals and the values are their respective weights,
 * write a program to calculate the total weight by using the multiplication assignment operator.
 *
 * Example:
 * val weightDict = mapOf("lion" to 150, "elephant" to 3000, "giraffe" to 800, "rhino" to 2000)
 * var totalWeight = 0
 *
 * Implement your code to iterate through each animal and accumulate its weight to the totalWeight variable.
 *
 * Hint: Use the multiplication assignment operator (*=) to multiply the weight of each animal with a factor.
 */
fun calculateTotalWeight(weightDict: Map<String, Int>): Int {

    var totalWeight = 0
    val factor = 1

    // Iterate through each animal's weight
    for ((animal, weight) in weightDict) {
        // Accumulate the weight to the totalWeight variable using the multiplication assignment operator
        totalWeight += weight * factor
    }

    return totalWeight
}