/**
 * This function calculates the total duration of a performance of a music piece, given the initial duration
 * of the piece and the number of times it should be repeated.
 *
 * @param initialDuration The initial duration of the music piece in minutes.
 * @param numberOfRepetitions The number of times the music piece should be repeated.
 * @return The total duration of the performance in minutes.
 * @throws IllegalArgumentException If the initialDuration is negative or the numberOfRepetitions is negative or zero.
 */
fun calculatePerformanceDuration(initialDuration: Double, numberOfRepetitions: Int): Double {

    // Perform input validation
    if (initialDuration < 0) {
        throw IllegalArgumentException("The initial duration cannot be negative.")
    }

    if (numberOfRepetitions < 1) {
        throw IllegalArgumentException("The number of repetitions should be at least 1.")
    }

    // Calculate the total duration
    val totalDuration = initialDuration * numberOfRepetitions

    return totalDuration
}

// Example usage
// Uncomment the lines below to test the function

// val performanceDuration = calculatePerformanceDuration(7.5, 4)
// println(performanceDuration)
/**
 * This function calculates the total duration of a performance of a music piece, given the initial duration
 * of the piece and the number of times it should be repeated.
 *
 * @param initialDuration The initial duration of the music piece in minutes.
 * @param numberOfRepetitions The number of times the music piece should be repeated.
 * @return The total duration of the performance in minutes.
 * @throws IllegalArgumentException If the initialDuration is negative or the numberOfRepetitions is negative or zero.
 */
fun calculatePerformanceDuration(initialDuration: Double, numberOfRepetitions: Int): Double {
/**
 * This function calculates the total duration of a performance of a music piece, given the initial duration
 * of the piece and the number of times it should be repeated.
 *
 * @param initialDuration The initial duration of the music piece in minutes.
 * @param numberOfRepetitions The number of times the music piece should be repeated.
 * @return The total duration of the performance in minutes.
 * @throws IllegalArgumentException If the initialDuration is negative or the numberOfRepetitions is negative or zero.
 */
fun calculatePerformanceDuration(initialDuration: Double, numberOfRepetitions: Int): Double {

    // Perform input validation
    if (initialDuration < 0) {
        throw IllegalArgumentException("The initial duration cannot be negative.")
    }

    if (numberOfRepetitions < 1) {
        throw IllegalArgumentException("The number of repetitions should be at least 1.")
    }

    // Calculate the total duration
    val totalDuration = initialDuration * numberOfRepetitions

    return totalDuration
}

// Example usage
// Uncomment the lines below to test the function

// val performanceDuration = calculatePerformanceDuration(7.5, 4)
// println(performanceDuration)