/**
 * This exercise is for a physical therapist to practice working with while loops and string methods.
 *
 * You have been given a list of patient names and their rehabilitation statuses.
 * Your task is to print the name of each patient and their current rehabilitation status.
 * However, the rehabilitation status should only be displayed if the patient's name contains the letter 'a'.
 *
 * @param patientData A list of strings in the format "patient_name:rehab_status".
 */
fun printPatientRehabStatus(patientData: List<String>) {

    // Initialize an index variable to keep track of the current position in the list
    var index = 0

    // Iterate through each item in the list using a while loop
    while (index < patientData.size) {
        // Extract the patient name and rehab status from the current item in the list
        val patientInfo = patientData[index].split(":")
        val patientName = patientInfo[0]
        val rehabStatus = patientInfo[1]

        // Check if the patient's name contains the letter 'a'
        if ('a' in patientName) {
            // Print the patient's name and rehabilitation status
            println("Patient: $patientName, Rehab Status: $rehabStatus")
        }

        index++
    }
}
/**
 * This exercise is for a physical therapist to practice working with while loops and string methods.
 *
 * You have been given a list of patient names and their rehabilitation statuses.
 * Your task is to print the name of each patient and their current rehabilitation status.
 * However, the rehabilitation status should only be displayed if the patient's name contains the letter 'a'.
 *
 * @param patientData A list of strings in the format "patient_name:rehab_status".
 */
fun printPatientRehabStatus(patientData: List<String>) {
/**
 * This exercise is for a physical therapist to practice working with while loops and string methods.
 *
 * You have been given a list of patient names and their rehabilitation statuses.
 * Your task is to print the name of each patient and their current rehabilitation status.
 * However, the rehabilitation status should only be displayed if the patient's name contains the letter 'a'.
 *
 * @param patientData A list of strings in the format "patient_name:rehab_status".
 */
fun printPatientRehabStatus(patientData: List<String>) {

    // Initialize an index variable to keep track of the current position in the list
    var index = 0

    // Iterate through each item in the list using a while loop
    while (index < patientData.size) {
        // Extract the patient name and rehab status from the current item in the list
        val patientInfo = patientData[index].split(":")
        val patientName = patientInfo[0]
        val rehabStatus = patientInfo[1]

        // Check if the patient's name contains the letter 'a'
        if ('a' in patientName) {
            // Print the patient's name and rehabilitation status
            println("Patient: $patientName, Rehab Status: $rehabStatus")
        }

        index++
    }
}