/**
 * This exercise will test your ability to use the unconditioned ternary operator along with modifying elements 
 * using list comprehensions. Your task is to modify the given list of velocities where any velocity above the 
 * specified threshold is squared, and any velocity below or equal to the threshold remains unchanged. The modified 
 * list should be returned as the output.
 * 
 * @param velocityList A list of velocities (float numbers)
 * @param threshold The threshold value that determines whether a velocity should be squared or not
 * @return The modified list of velocities
 * 
 * Example:
 * modifyElements(listOf(1.5, 3.2, 2.9, 4.8, 1.2, 0.7), 2.0)
 * Output: [1.5, 3.2, 2.9, 23.04, 1.44, 0.49]
 */
fun modifyElements(velocityList: List<Double>, threshold: Double): List<Double> {

    return velocityList.map { if (it > threshold) it * it else it }
}
/**
 * This exercise will test your ability to use the unconditioned ternary operator along with modifying elements 
 * using list comprehensions. Your task is to modify the given list of velocities where any velocity above the 
 * specified threshold is squared, and any velocity below or equal to the threshold remains unchanged. The modified 
 * list should be returned as the output.
 * 
 * @param velocityList A list of velocities (float numbers)
 * @param threshold The threshold value that determines whether a velocity should be squared or not
 * @return The modified list of velocities
 * 
 * Example:
 * modifyElements(listOf(1.5, 3.2, 2.9, 4.8, 1.2, 0.7), 2.0)
 * Output: [1.5, 3.2, 2.9, 23.04, 1.44, 0.49]
 */
fun modifyElements(velocityList: List<Double>, threshold: Double): List<Double> {
/**
 * This exercise will test your ability to use the unconditioned ternary operator along with modifying elements 
 * using list comprehensions. Your task is to modify the given list of velocities where any velocity above the 
 * specified threshold is squared, and any velocity below or equal to the threshold remains unchanged. The modified 
 * list should be returned as the output.
 * 
 * @param velocityList A list of velocities (float numbers)
 * @param threshold The threshold value that determines whether a velocity should be squared or not
 * @return The modified list of velocities
 * 
 * Example:
 * modifyElements(listOf(1.5, 3.2, 2.9, 4.8, 1.2, 0.7), 2.0)
 * Output: [1.5, 3.2, 2.9, 23.04, 1.44, 0.49]
 */
fun modifyElements(velocityList: List<Double>, threshold: Double): List<Double> {

    return velocityList.map { if (it > threshold) it * it else it }
}