/**
 * Calculate the total cost of vaccinations for all pets.
 *
 * @param pets List of tuples containing the name and age of each pet.
 * @param vaccinations Dictionary mapping the vaccination type to its cost.
 * @return Total cost of vaccinations for all pets.
 */
fun calculateTotalCost(pets: List<Pair<String, Int>>, vaccinations: Map<String, Float>): Float {

    var totalCost = 0f
    
    for ((name, age) in pets) {
        val cost = when {
            age < 1 -> vaccinations["puppy"] ?: 0f
            age < 5 -> vaccinations["adult"] ?: 0f
            else -> vaccinations["senior"] ?: 0f
        }
        
        totalCost += cost
    }
    
    return totalCost
}
/**
 * Calculate the total cost of vaccinations for all pets.
 *
 * @param pets List of tuples containing the name and age of each pet.
 * @param vaccinations Dictionary mapping the vaccination type to its cost.
 * @return Total cost of vaccinations for all pets.
 */
fun calculateTotalCost(pets: List<Pair<String, Int>>, vaccinations: Map<String, Float>): Float {
/**
 * Calculate the total cost of vaccinations for all pets.
 *
 * @param pets List of tuples containing the name and age of each pet.
 * @param vaccinations Dictionary mapping the vaccination type to its cost.
 * @return Total cost of vaccinations for all pets.
 */
fun calculateTotalCost(pets: List<Pair<String, Int>>, vaccinations: Map<String, Float>): Float {

    var totalCost = 0f
    
    for ((name, age) in pets) {
        val cost = when {
            age < 1 -> vaccinations["puppy"] ?: 0f
            age < 5 -> vaccinations["adult"] ?: 0f
            else -> vaccinations["senior"] ?: 0f
        }
        
        totalCost += cost
    }
    
    return totalCost
}