/**
 * Athlete's Subtraction Assignment Looping Exercise
 *
 * This exercise is designed to test your knowledge of looping structures and the subtraction assignment operator.
 * Your goal is to simulate a runner's training session, where they start at a specific distance and run a certain number of laps.
 * Use the subtraction assignment operator to update the distance after each lap and ensure it goes below zero.
 *
 * @param athleteName The name of the athlete.
 * @param startingDistance The initial distance the athlete will run.
 * @param laps The number of laps the athlete will complete.
 * @return A summary message indicating the final distance covered.
 *
 * Example:
 * subtractAssignmentLoop("John", 10.0, 3) => "John completed 3 laps and covered -20.0 meters."
 */
fun subtractAssignmentLoop(athleteName: String, startingDistance: Double, laps: Int): String {

    var distance = startingDistance
    var lapCount = 0

    while (lapCount < laps) {
        lapCount++
        distance -= lapCount * 5
    }

    return "$athleteName completed $lapCount laps and covered $distance meters."
}
/**
 * Athlete's Subtraction Assignment Looping Exercise
 *
 * This exercise is designed to test your knowledge of looping structures and the subtraction assignment operator.
 * Your goal is to simulate a runner's training session, where they start at a specific distance and run a certain number of laps.
 * Use the subtraction assignment operator to update the distance after each lap and ensure it goes below zero.
 *
 * @param athleteName The name of the athlete.
 * @param startingDistance The initial distance the athlete will run.
 * @param laps The number of laps the athlete will complete.
 * @return A summary message indicating the final distance covered.
 *
 * Example:
 * subtractAssignmentLoop("John", 10.0, 3) => "John completed 3 laps and covered -20.0 meters."
 */
fun subtractAssignmentLoop(athleteName: String, startingDistance: Double, laps: Int): String {
/**
 * Athlete's Subtraction Assignment Looping Exercise
 *
 * This exercise is designed to test your knowledge of looping structures and the subtraction assignment operator.
 * Your goal is to simulate a runner's training session, where they start at a specific distance and run a certain number of laps.
 * Use the subtraction assignment operator to update the distance after each lap and ensure it goes below zero.
 *
 * @param athleteName The name of the athlete.
 * @param startingDistance The initial distance the athlete will run.
 * @param laps The number of laps the athlete will complete.
 * @return A summary message indicating the final distance covered.
 *
 * Example:
 * subtractAssignmentLoop("John", 10.0, 3) => "John completed 3 laps and covered -20.0 meters."
 */
fun subtractAssignmentLoop(athleteName: String, startingDistance: Double, laps: Int): String {

    var distance = startingDistance
    var lapCount = 0

    while (lapCount < laps) {
        lapCount++
        distance -= lapCount * 5
    }

    return "$athleteName completed $lapCount laps and covered $distance meters."
}