/**
 * A police officer is issuing a ticket based on the speed and violation of a driver.
 *
 * @param speed The speed at which the driver was traveling.
 * @param violation The type of violation committed by the driver.
 * @return The type of ticket issued by the police officer.
 */
fun issueTicket(speed: Float, violation: String): String {

    return when {
        speed > 100 && violation != "DUI" -> {
            when (violation) {
                "Reckless driving" -> "Super Speeder Ticket"
                "Running red light" -> "Speeding Ticket"
                "Illegal street racing" -> "Super Speeder Ticket"
                else -> "Ticket"
            }
        }
        speed > 80 && violation != "DUI" -> {
            when (violation) {
                "Running red light" -> "Speeding Ticket"
                "Illegal street racing" -> "Ticket"
                "Distracted driving" -> "Ticket"
                else -> "No Ticket"
            }
        }
        else -> {
            when {
                violation == "Running red light" || violation == "Illegal street racing" -> "Warning"
                violation == "DUI" -> ""
                else -> "No Ticket"
            }
        }
    }
}
/**
 * A police officer is issuing a ticket based on the speed and violation of a driver.
 *
 * @param speed The speed at which the driver was traveling.
 * @param violation The type of violation committed by the driver.
 * @return The type of ticket issued by the police officer.
 */
fun issueTicket(speed: Float, violation: String): String {
/**
 * A police officer is issuing a ticket based on the speed and violation of a driver.
 *
 * @param speed The speed at which the driver was traveling.
 * @param violation The type of violation committed by the driver.
 * @return The type of ticket issued by the police officer.
 */
fun issueTicket(speed: Float, violation: String): String {

    return when {
        speed > 100 && violation != "DUI" -> {
            when (violation) {
                "Reckless driving" -> "Super Speeder Ticket"
                "Running red light" -> "Speeding Ticket"
                "Illegal street racing" -> "Super Speeder Ticket"
                else -> "Ticket"
            }
        }
        speed > 80 && violation != "DUI" -> {
            when (violation) {
                "Running red light" -> "Speeding Ticket"
                "Illegal street racing" -> "Ticket"
                "Distracted driving" -> "Ticket"
                else -> "No Ticket"
            }
        }
        else -> {
            when {
                violation == "Running red light" || violation == "Illegal street racing" -> "Warning"
                violation == "DUI" -> ""
                else -> "No Ticket"
            }
        }
    }
}