/**
 * A function to create a firefighter object with name, age, and hometown parameters.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param hometown The hometown of the firefighter.
 * @return A string representing the firefighter's information.
 */
fun firefighter(name: String, age: Int, hometown: String): String {

    var firefighterInfo = "Firefighter: $name, $age, $hometown"

    // Task 1: Get the first three characters of the firefighter's name
    val nameSlice = name.take(3)

    // Task 2: Multiply the age by 2 and assign it to the age variable
    var updatedAge = age * 2

    // Task 3: Get the last two characters of the hometown
    val hometownSlice = hometown.takeLast(2)

    // Task 4: Concatenate the nameSlice, updatedAge, and hometownSlice with a space separation
    val firefighterInfoUpdated = "$nameSlice $updatedAge $hometownSlice"

    return firefighterInfoUpdated
}
/**
 * A function to create a firefighter object with name, age, and hometown parameters.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param hometown The hometown of the firefighter.
 * @return A string representing the firefighter's information.
 */
fun firefighter(name: String, age: Int, hometown: String): String {
/**
 * A function to create a firefighter object with name, age, and hometown parameters.
 *
 * @param name The name of the firefighter.
 * @param age The age of the firefighter.
 * @param hometown The hometown of the firefighter.
 * @return A string representing the firefighter's information.
 */
fun firefighter(name: String, age: Int, hometown: String): String {

    var firefighterInfo = "Firefighter: $name, $age, $hometown"

    // Task 1: Get the first three characters of the firefighter's name
    val nameSlice = name.take(3)

    // Task 2: Multiply the age by 2 and assign it to the age variable
    var updatedAge = age * 2

    // Task 3: Get the last two characters of the hometown
    val hometownSlice = hometown.takeLast(2)

    // Task 4: Concatenate the nameSlice, updatedAge, and hometownSlice with a space separation
    val firefighterInfoUpdated = "$nameSlice $updatedAge $hometownSlice"

    return firefighterInfoUpdated
}