/**
 * Your list of bookRatings consists of dictionaries with the book's title as the key and its rating as the value.
 * You need to find the average rating of all the books and return it.
 *
 * Hint: Iterate over the dictionary and compute the sum of all the ratings, then divide it by the total number of books.
 */
fun returnAvgBookRatings(bookRatings: Map<String, Int>): Double {

    var totalRatings = 0
    var totalBooks = 0

    // Iterate over the dictionary
    for (rating in bookRatings.values) {
        totalRatings += rating
        totalBooks++
    }

    val avgRating = totalRatings.toDouble() / totalBooks
    return avgRating
}
/**
 * Your list of bookRatings consists of dictionaries with the book's title as the key and its rating as the value.
 * You need to find the average rating of all the books and return it.
 *
 * Hint: Iterate over the dictionary and compute the sum of all the ratings, then divide it by the total number of books.
 */
fun returnAvgBookRatings(bookRatings: Map<String, Int>): Double {
/**
 * Your list of bookRatings consists of dictionaries with the book's title as the key and its rating as the value.
 * You need to find the average rating of all the books and return it.
 *
 * Hint: Iterate over the dictionary and compute the sum of all the ratings, then divide it by the total number of books.
 */
fun returnAvgBookRatings(bookRatings: Map<String, Int>): Double {

    var totalRatings = 0
    var totalBooks = 0

    // Iterate over the dictionary
    for (rating in bookRatings.values) {
        totalRatings += rating
        totalBooks++
    }

    val avgRating = totalRatings.toDouble() / totalBooks
    return avgRating
}