/**
 * This function takes in a nested list of vet visits and calculates the total invoice amount.
 * Each vet visit has a list of treatments with their corresponding costs.
 * The total invoice amount is calculated by multiplying the cost of each treatment with the number of visits
 * and summing them all together.
 *
 * @param vetVisits A nested list of vet visits, where each visit contains a list of treatments with their costs.
 * @return The total invoice amount.
 *
 * Example:
 * val vetVisits = listOf(
 *     listOf("Vaccination" to 100, "Flea treatment" to 50, "Nail trimming" to 20),
 *     listOf("Check-up" to 80, "X-ray" to 200, "Deworming" to 40),
 *     listOf("Dental cleaning" to 150, "Blood test" to 120, "Medication" to 60)
 * )
 * calculateTotalInvoice(vetVisits) -> 2040.0
 */
fun calculateTotalInvoice(vetVisits: List<List<Pair<String, Int>>>): Double {

    var totalInvoice = 0.0

    for (visit in vetVisits) {
        for (treatment in visit) {
            totalInvoice += treatment.second
        }
    }

    return totalInvoice
}
/**
 * This function takes in a nested list of vet visits and calculates the total invoice amount.
 * Each vet visit has a list of treatments with their corresponding costs.
 * The total invoice amount is calculated by multiplying the cost of each treatment with the number of visits
 * and summing them all together.
 *
 * @param vetVisits A nested list of vet visits, where each visit contains a list of treatments with their costs.
 * @return The total invoice amount.
 *
 * Example:
 * val vetVisits = listOf(
 *     listOf("Vaccination" to 100, "Flea treatment" to 50, "Nail trimming" to 20),
 *     listOf("Check-up" to 80, "X-ray" to 200, "Deworming" to 40),
 *     listOf("Dental cleaning" to 150, "Blood test" to 120, "Medication" to 60)
 * )
 * calculateTotalInvoice(vetVisits) -> 2040.0
 */
fun calculateTotalInvoice(vetVisits: List<List<Pair<String, Int>>>): Double {
/**
 * This function takes in a nested list of vet visits and calculates the total invoice amount.
 * Each vet visit has a list of treatments with their corresponding costs.
 * The total invoice amount is calculated by multiplying the cost of each treatment with the number of visits
 * and summing them all together.
 *
 * @param vetVisits A nested list of vet visits, where each visit contains a list of treatments with their costs.
 * @return The total invoice amount.
 *
 * Example:
 * val vetVisits = listOf(
 *     listOf("Vaccination" to 100, "Flea treatment" to 50, "Nail trimming" to 20),
 *     listOf("Check-up" to 80, "X-ray" to 200, "Deworming" to 40),
 *     listOf("Dental cleaning" to 150, "Blood test" to 120, "Medication" to 60)
 * )
 * calculateTotalInvoice(vetVisits) -> 2040.0
 */
fun calculateTotalInvoice(vetVisits: List<List<Pair<String, Int>>>): Double {

    var totalInvoice = 0.0

    for (visit in vetVisits) {
        for (treatment in visit) {
            totalInvoice += treatment.second
        }
    }

    return totalInvoice
}