/**
 * This function takes the initial area, width, length, and floor number as arguments.
 * It calculates and returns the new area of the floor after adding the area of a given space (width * length) to it.
 *
 * @param area initial floor area
 * @param width width of the given space
 * @param length length of the given space
 * @param floor floor number
 * @return updated floor area after adding the area of the given space
 */
fun addFloorArea(area: Double, width: Double, length: Double, floor: Int): Double {

    var newArea = area

    if (width > 0 && length > 0) {
        if (floor > 0) {
            // Add the area of the given space to the initial area of the floor
            newArea += width * length
        } else {
            newArea = 0.0 // Reset the area to 0 if the floor number is less than or equal to 0
        }
    } else {
        // Error message for invalid width or length values
        newArea = 0.0
    }

    return newArea
}
/**
 * This function takes the initial area, width, length, and floor number as arguments.
 * It calculates and returns the new area of the floor after adding the area of a given space (width * length) to it.
 *
 * @param area initial floor area
 * @param width width of the given space
 * @param length length of the given space
 * @param floor floor number
 * @return updated floor area after adding the area of the given space
 */
fun addFloorArea(area: Double, width: Double, length: Double, floor: Int): Double {
/**
 * This function takes the initial area, width, length, and floor number as arguments.
 * It calculates and returns the new area of the floor after adding the area of a given space (width * length) to it.
 *
 * @param area initial floor area
 * @param width width of the given space
 * @param length length of the given space
 * @param floor floor number
 * @return updated floor area after adding the area of the given space
 */
fun addFloorArea(area: Double, width: Double, length: Double, floor: Int): Double {

    var newArea = area

    if (width > 0 && length > 0) {
        if (floor > 0) {
            // Add the area of the given space to the initial area of the floor
            newArea += width * length
        } else {
            newArea = 0.0 // Reset the area to 0 if the floor number is less than or equal to 0
        }
    } else {
        // Error message for invalid width or length values
        newArea = 0.0
    }

    return newArea
}