/**
 * A carpenter needs to calculate the total length of boards required for a project.
 * Given the width and thickness of each board, and the total number of boards needed,
 * the function should return the overall length of boards required for the project.
 *
 * @param boardWidth The width of each board in inches.
 * @param boardThickness The thickness of each board in inches.
 * @param numBoards The total number of boards needed.
 * @return The total length of boards required in inches.
 *
 * Example:
 * calculateBoardLength(6.5, 1.375, 10) -> 87.5
 */
fun calculateBoardLength(boardWidth: Double, boardThickness: Double, numBoards: Int): Double {

    var totalLength = 0.0

    // Iterate 'numBoards' times to calculate the length of each board
    repeat(numBoards) {
        // Input the desired length for board number i
        print("Enter the desired length in inches for board ${it + 1}: ")
        val boardLength = readLine()!!.toDouble()

        // Add the calculated length of board i to the total length
        totalLength += boardLength
    }

    return totalLength
}
/**
 * A carpenter needs to calculate the total length of boards required for a project.
 * Given the width and thickness of each board, and the total number of boards needed,
 * the function should return the overall length of boards required for the project.
 *
 * @param boardWidth The width of each board in inches.
 * @param boardThickness The thickness of each board in inches.
 * @param numBoards The total number of boards needed.
 * @return The total length of boards required in inches.
 *
 * Example:
 * calculateBoardLength(6.5, 1.375, 10) -> 87.5
 */
fun calculateBoardLength(boardWidth: Double, boardThickness: Double, numBoards: Int): Double {
/**
 * A carpenter needs to calculate the total length of boards required for a project.
 * Given the width and thickness of each board, and the total number of boards needed,
 * the function should return the overall length of boards required for the project.
 *
 * @param boardWidth The width of each board in inches.
 * @param boardThickness The thickness of each board in inches.
 * @param numBoards The total number of boards needed.
 * @return The total length of boards required in inches.
 *
 * Example:
 * calculateBoardLength(6.5, 1.375, 10) -> 87.5
 */
fun calculateBoardLength(boardWidth: Double, boardThickness: Double, numBoards: Int): Double {

    var totalLength = 0.0

    // Iterate 'numBoards' times to calculate the length of each board
    repeat(numBoards) {
        // Input the desired length for board number i
        print("Enter the desired length in inches for board ${it + 1}: ")
        val boardLength = readLine()!!.toDouble()

        // Add the calculated length of board i to the total length
        totalLength += boardLength
    }

    return totalLength
}