/**
 * This function calculates the quantity of materials needed for a carpentry project
 * based on the dimensions of the project and the material requirements.
 *
 * @param materials A nested list containing the material code and quantity required per unit area.
 * Example: listOf(listOf("Wood Panels", 2), listOf("Nails", 20), listOf("Screws", 10))
 * @param length The length of the project in meters.
 * @param width The width of the project in meters.
 * @param depth The depth or thickness of the project in meters.
 * @return A map with the material code as the key and the required quantity as the value.
 */
fun calculateMaterialQuantity(materials: List<List<Any>>, length: Double, width: Double, depth: Double): Map<String, Double> {

    val materialQuantity = mutableMapOf<String, Double>()

    for (material in materials) {
        val materialName = material[0] as String
        val quantity = material[1] as Int
        val materialAmount = quantity * length * width * depth
        materialQuantity[materialName] = materialAmount
    }

    return materialQuantity
}
/**
 * This function calculates the quantity of materials needed for a carpentry project
 * based on the dimensions of the project and the material requirements.
 *
 * @param materials A nested list containing the material code and quantity required per unit area.
 * Example: listOf(listOf("Wood Panels", 2), listOf("Nails", 20), listOf("Screws", 10))
 * @param length The length of the project in meters.
 * @param width The width of the project in meters.
 * @param depth The depth or thickness of the project in meters.
 * @return A map with the material code as the key and the required quantity as the value.
 */
fun calculateMaterialQuantity(materials: List<List<Any>>, length: Double, width: Double, depth: Double): Map<String, Double> {
/**
 * This function calculates the quantity of materials needed for a carpentry project
 * based on the dimensions of the project and the material requirements.
 *
 * @param materials A nested list containing the material code and quantity required per unit area.
 * Example: listOf(listOf("Wood Panels", 2), listOf("Nails", 20), listOf("Screws", 10))
 * @param length The length of the project in meters.
 * @param width The width of the project in meters.
 * @param depth The depth or thickness of the project in meters.
 * @return A map with the material code as the key and the required quantity as the value.
 */
fun calculateMaterialQuantity(materials: List<List<Any>>, length: Double, width: Double, depth: Double): Map<String, Double> {

    val materialQuantity = mutableMapOf<String, Double>()

    for (material in materials) {
        val materialName = material[0] as String
        val quantity = material[1] as Int
        val materialAmount = quantity * length * width * depth
        materialQuantity[materialName] = materialAmount
    }

    return materialQuantity
}