/**
 * Given the type of lumber, the required length, and the quantity, calculates the cutting instructions for a carpenter.
 *
 * @param lumberType The type of lumber (e.g., 'pine', 'oak', 'walnut').
 * @param length The required length in inches.
 * @param quantity The number of pieces needed.
 * @return A string containing the cutting instructions.
 * @throws IllegalArgumentException If the lumber type is not valid.
 */
fun calculateCuttingInstructions(lumberType: String, length: Int, quantity: Int): String {

    val cuttingInstructions: String = when (lumberType) {
        "pine" -> "Cut $length pine boards to $length inches each to get $quantity pieces."
        "oak" -> "Cut $length oak boards to $length inches each to get $quantity pieces."
        "walnut" -> "Cut $length walnut boards to $length inches each to get $quantity pieces."
        else -> throw IllegalArgumentException("Invalid lumber type provided.")
    }
    return cuttingInstructions
}
/**
 * Given the type of lumber, the required length, and the quantity, calculates the cutting instructions for a carpenter.
 *
 * @param lumberType The type of lumber (e.g., 'pine', 'oak', 'walnut').
 * @param length The required length in inches.
 * @param quantity The number of pieces needed.
 * @return A string containing the cutting instructions.
 * @throws IllegalArgumentException If the lumber type is not valid.
 */
fun calculateCuttingInstructions(lumberType: String, length: Int, quantity: Int): String {
/**
 * Given the type of lumber, the required length, and the quantity, calculates the cutting instructions for a carpenter.
 *
 * @param lumberType The type of lumber (e.g., 'pine', 'oak', 'walnut').
 * @param length The required length in inches.
 * @param quantity The number of pieces needed.
 * @return A string containing the cutting instructions.
 * @throws IllegalArgumentException If the lumber type is not valid.
 */
fun calculateCuttingInstructions(lumberType: String, length: Int, quantity: Int): String {

    val cuttingInstructions: String = when (lumberType) {
        "pine" -> "Cut $length pine boards to $length inches each to get $quantity pieces."
        "oak" -> "Cut $length oak boards to $length inches each to get $quantity pieces."
        "walnut" -> "Cut $length walnut boards to $length inches each to get $quantity pieces."
        else -> throw IllegalArgumentException("Invalid lumber type provided.")
    }
    return cuttingInstructions
}