/**
 * You are working as an artist manager and need to calculate the income of an artist after deducting the commission.
 * Given a list of artwork prices and the commission rate, write a function to calculate the net income for the artist.
 *
 * @param artworkPrices a list of prices for each artwork sold by the artist
 * @param commissionRate the percentage of commission deducted from each artwork sold
 * @return the artist's income after deducting the commission
 *
 * Example:
 * calculateArtistIncome(listOf(1000, 2000, 1500), 20)
 * Output: 3400
 *
 * Note:
 * - Artwork prices are represented as integers.
 * - Commission rate should be specified as a whole number (e.g., 20 for 20%).
 */
fun calculateArtistIncome(artworkPrices: List<Int>, commissionRate: Int): Int {

    var totalIncome = 0

    for (price in artworkPrices) {
        val commission = price * commissionRate / 100
        val netPrice = price - commission

        totalIncome += netPrice
    }

    return totalIncome
}
/**
 * You are working as an artist manager and need to calculate the income of an artist after deducting the commission.
 * Given a list of artwork prices and the commission rate, write a function to calculate the net income for the artist.
 *
 * @param artworkPrices a list of prices for each artwork sold by the artist
 * @param commissionRate the percentage of commission deducted from each artwork sold
 * @return the artist's income after deducting the commission
 *
 * Example:
 * calculateArtistIncome(listOf(1000, 2000, 1500), 20)
 * Output: 3400
 *
 * Note:
 * - Artwork prices are represented as integers.
 * - Commission rate should be specified as a whole number (e.g., 20 for 20%).
 */
fun calculateArtistIncome(artworkPrices: List<Int>, commissionRate: Int): Int {
/**
 * You are working as an artist manager and need to calculate the income of an artist after deducting the commission.
 * Given a list of artwork prices and the commission rate, write a function to calculate the net income for the artist.
 *
 * @param artworkPrices a list of prices for each artwork sold by the artist
 * @param commissionRate the percentage of commission deducted from each artwork sold
 * @return the artist's income after deducting the commission
 *
 * Example:
 * calculateArtistIncome(listOf(1000, 2000, 1500), 20)
 * Output: 3400
 *
 * Note:
 * - Artwork prices are represented as integers.
 * - Commission rate should be specified as a whole number (e.g., 20 for 20%).
 */
fun calculateArtistIncome(artworkPrices: List<Int>, commissionRate: Int): Int {

    var totalIncome = 0

    for (price in artworkPrices) {
        val commission = price * commissionRate / 100
        val netPrice = price - commission

        totalIncome += netPrice
    }

    return totalIncome
}