/**
 * Given the number of beams 'n' and their dimensions 'a', 'b', 'c',
 * calculate the maximum bending moment for each beam.
 *
 * @param n number of beams
 * @param a width of the beam in meters
 * @param b height of the beam in meters
 * @param c length of the beam in meters
 * @return a list containing the maximum bending moment for each beam
 *
 * The bending moment is calculated using the following formula:
 * M = (3 * n * a * b * c) / (2 * (b + c))
 */
fun calculateBeamMoment(n: Int, a: Double, b: Double, c: Double): List<Double> {

    val moments = mutableListOf<Double>()  // Initialize an empty list to store the bending moments

    // Loop through each beam
    repeat(n) {
        // Prompt the user to enter the beam number and dimensions
        // Notice the nested input statements
        print("Enter the beam number: ")
        val beamNumber = readLine()!!.toInt()
        println("Enter the dimensions of beam $beamNumber:")
        print("Width (in meters): ")
        val width = readLine()!!.toDouble()
        print("Height (in meters): ")
        val height = readLine()!!.toDouble()

        // Calculate the bending moment for the current beam
        val moment = (3 * n * a * b * c) / (2 * (b + c))
        moments.add(moment)  // Add the calculated moment to the list
    }

    return moments
}
/**
 * Given the number of beams 'n' and their dimensions 'a', 'b', 'c',
 * calculate the maximum bending moment for each beam.
 *
 * @param n number of beams
 * @param a width of the beam in meters
 * @param b height of the beam in meters
 * @param c length of the beam in meters
 * @return a list containing the maximum bending moment for each beam
 *
 * The bending moment is calculated using the following formula:
 * M = (3 * n * a * b * c) / (2 * (b + c))
 */
fun calculateBeamMoment(n: Int, a: Double, b: Double, c: Double): List<Double> {
/**
 * Given the number of beams 'n' and their dimensions 'a', 'b', 'c',
 * calculate the maximum bending moment for each beam.
 *
 * @param n number of beams
 * @param a width of the beam in meters
 * @param b height of the beam in meters
 * @param c length of the beam in meters
 * @return a list containing the maximum bending moment for each beam
 *
 * The bending moment is calculated using the following formula:
 * M = (3 * n * a * b * c) / (2 * (b + c))
 */
fun calculateBeamMoment(n: Int, a: Double, b: Double, c: Double): List<Double> {

    val moments = mutableListOf<Double>()  // Initialize an empty list to store the bending moments

    // Loop through each beam
    repeat(n) {
        // Prompt the user to enter the beam number and dimensions
        // Notice the nested input statements
        print("Enter the beam number: ")
        val beamNumber = readLine()!!.toInt()
        println("Enter the dimensions of beam $beamNumber:")
        print("Width (in meters): ")
        val width = readLine()!!.toDouble()
        print("Height (in meters): ")
        val height = readLine()!!.toDouble()

        // Calculate the bending moment for the current beam
        val moment = (3 * n * a * b * c) / (2 * (b + c))
        moments.add(moment)  // Add the calculated moment to the list
    }

    return moments
}