/**
 * This function calculates the velocity of an object in a straight line motion using the formula: velocity = initialVelocity + acceleration * time.
 *
 * @param time the time (in seconds) at which the velocity needs to be calculated.
 * @param acceleration the constant acceleration (in m/s^2) of the object.
 * @return the final velocity (in m/s) of the object.
 */
fun calculateVelocity(time: Float, acceleration: Float): Float {

    val initialVelocity = 0f  // Assign an initial velocity of 0 m/s
    var velocity = 0f

    // Create a for loop to iterate over a range of values from 0 to time (inclusive)
    for (t in 0..time.toInt()) {
        velocity = initialVelocity + acceleration * t
    }

    // Return the final velocity
    return velocity
}
/**
 * This function calculates the velocity of an object in a straight line motion using the formula: velocity = initialVelocity + acceleration * time.
 *
 * @param time the time (in seconds) at which the velocity needs to be calculated.
 * @param acceleration the constant acceleration (in m/s^2) of the object.
 * @return the final velocity (in m/s) of the object.
 */
fun calculateVelocity(time: Float, acceleration: Float): Float {
/**
 * This function calculates the velocity of an object in a straight line motion using the formula: velocity = initialVelocity + acceleration * time.
 *
 * @param time the time (in seconds) at which the velocity needs to be calculated.
 * @param acceleration the constant acceleration (in m/s^2) of the object.
 * @return the final velocity (in m/s) of the object.
 */
fun calculateVelocity(time: Float, acceleration: Float): Float {

    val initialVelocity = 0f  // Assign an initial velocity of 0 m/s
    var velocity = 0f

    // Create a for loop to iterate over a range of values from 0 to time (inclusive)
    for (t in 0..time.toInt()) {
        velocity = initialVelocity + acceleration * t
    }

    // Return the final velocity
    return velocity
}