/**
 * This function calculates the total income of an artist based on their album sales data.
 *
 * @param artistData A tuple containing the artist's name, number of albums released, and average price of each album.
 * @param albumSales A dictionary with album names as keys and their respective number of sales as values.
 * @return The total income generated by the artist.
 */
fun calculateArtistIncome(artistData: Triple<String, Int, Double>, albumSales: Map<String, Int>): Double {

    val (artistName, numAlbums, albumPrice) = artistData
    
    // Calculate the total income
    var income = 0.0
    
    for ((albumName, salesCount) in albumSales) {
        // Multiply the album price by the sales count and add it to the total income
        income += albumPrice * salesCount
    }
    
    return income
}
/**
 * This function calculates the total income of an artist based on their album sales data.
 *
 * @param artistData A tuple containing the artist's name, number of albums released, and average price of each album.
 * @param albumSales A dictionary with album names as keys and their respective number of sales as values.
 * @return The total income generated by the artist.
 */
fun calculateArtistIncome(artistData: Triple<String, Int, Double>, albumSales: Map<String, Int>): Double {
/**
 * This function calculates the total income of an artist based on their album sales data.
 *
 * @param artistData A tuple containing the artist's name, number of albums released, and average price of each album.
 * @param albumSales A dictionary with album names as keys and their respective number of sales as values.
 * @return The total income generated by the artist.
 */
fun calculateArtistIncome(artistData: Triple<String, Int, Double>, albumSales: Map<String, Int>): Double {

    val (artistName, numAlbums, albumPrice) = artistData
    
    // Calculate the total income
    var income = 0.0
    
    for ((albumName, salesCount) in albumSales) {
        // Multiply the album price by the sales count and add it to the total income
        income += albumPrice * salesCount
    }
    
    return income
}