/**
 * Create a tuple containing information about a civil engineer using parentheses.
 * The tuple should have the following elements in order:
 * - Full name (string)
 * - Age (integer)
 * - Specialization (string)
 * - Years of experience (integer)
 * - Education (string)
 *
 * Use nested try-except statements to ensure error handling and make the exercise more challenging.
 *
 * @return A tuple representing the civil engineer's information.
 */
fun createCivilEngineerTuple(): Triple<String, Int, String> {

    print("Enter the civil engineer's full name: ")
    val fullName = readLine() ?: ""

    var age = 0
    var specialization = ""
    var yearsOfExperience = 0
    var education = ""

    try {
        print("Enter the civil engineer's age: ")
        age = readLine()?.toInt() ?: 0

        try {
            print("Enter the civil engineer's specialization: ")
            specialization = readLine() ?: ""

            try {
                print("Enter the civil engineer's years of experience: ")
                yearsOfExperience = readLine()?.toInt() ?: 0

                try {
                    print("Enter the civil engineer's education: ")
                    education = readLine() ?: ""

                } catch (e: NumberFormatException) {
                    println("Invalid education format. Please try again.")
                    return createCivilEngineerTuple()
                }

            } catch (e: NumberFormatException) {
                println("Invalid years of experience format. Please try again.")
                return createCivilEngineerTuple()
            }

        } catch (e: NumberFormatException) {
            println("Invalid specialization format. Please try again.")
            return createCivilEngineerTuple()
        }

    } catch (e: NumberFormatException) {
        println("Invalid age format. Please try again.")
        return createCivilEngineerTuple()
    }

    return Triple(fullName, age, specialization)
}
/**
 * Create a tuple containing information about a civil engineer using parentheses.
 * The tuple should have the following elements in order:
 * - Full name (string)
 * - Age (integer)
 * - Specialization (string)
 * - Years of experience (integer)
 * - Education (string)
 *
 * Use nested try-except statements to ensure error handling and make the exercise more challenging.
 *
 * @return A tuple representing the civil engineer's information.
 */
fun createCivilEngineerTuple(): Triple<String, Int, String> {
/**
 * Create a tuple containing information about a civil engineer using parentheses.
 * The tuple should have the following elements in order:
 * - Full name (string)
 * - Age (integer)
 * - Specialization (string)
 * - Years of experience (integer)
 * - Education (string)
 *
 * Use nested try-except statements to ensure error handling and make the exercise more challenging.
 *
 * @return A tuple representing the civil engineer's information.
 */
fun createCivilEngineerTuple(): Triple<String, Int, String> {

    print("Enter the civil engineer's full name: ")
    val fullName = readLine() ?: ""

    var age = 0
    var specialization = ""
    var yearsOfExperience = 0
    var education = ""

    try {
        print("Enter the civil engineer's age: ")
        age = readLine()?.toInt() ?: 0

        try {
            print("Enter the civil engineer's specialization: ")
            specialization = readLine() ?: ""

            try {
                print("Enter the civil engineer's years of experience: ")
                yearsOfExperience = readLine()?.toInt() ?: 0

                try {
                    print("Enter the civil engineer's education: ")
                    education = readLine() ?: ""

                } catch (e: NumberFormatException) {
                    println("Invalid education format. Please try again.")
                    return createCivilEngineerTuple()
                }

            } catch (e: NumberFormatException) {
                println("Invalid years of experience format. Please try again.")
                return createCivilEngineerTuple()
            }

        } catch (e: NumberFormatException) {
            println("Invalid specialization format. Please try again.")
            return createCivilEngineerTuple()
        }

    } catch (e: NumberFormatException) {
        println("Invalid age format. Please try again.")
        return createCivilEngineerTuple()
    }

    return Triple(fullName, age, specialization)
}