/**
 * A police officer needs to check the license and speed of a driver. Complete the code to check the following:
 *
 * 1. If the license is valid, print "License is valid," otherwise, print "License is invalid."
 * 2. If the speed is less than or equal to 60, print "Driver is within speed limit."
 *    If the speed is between 61 and 80 (inclusive), print "Driver is speeding."
 *    If the speed is greater than 80, print "Driver is overspeeding! Take appropriate action."
 *    Note: Only print about the speed if the license is valid.
 *
 * @param license True if license is valid, False otherwise
 * @param speed the speed of the driver
 */
fun checkLicenseAndSpeeding(license: Boolean, speed: Int) {

    if (license) {
        // Enter your code here to check the speed within the given conditions
        when {
            speed <= 60 -> println("Driver is within speed limit.")
            speed in 61..80 -> println("Driver is speeding.")
            else -> println("Driver is overspeeding! Take appropriate action.")
        }
    } else {
        println("License is invalid.")
    }
}
/**
 * A police officer needs to check the license and speed of a driver. Complete the code to check the following:
 *
 * 1. If the license is valid, print "License is valid," otherwise, print "License is invalid."
 * 2. If the speed is less than or equal to 60, print "Driver is within speed limit."
 *    If the speed is between 61 and 80 (inclusive), print "Driver is speeding."
 *    If the speed is greater than 80, print "Driver is overspeeding! Take appropriate action."
 *    Note: Only print about the speed if the license is valid.
 *
 * @param license True if license is valid, False otherwise
 * @param speed the speed of the driver
 */
fun checkLicenseAndSpeeding(license: Boolean, speed: Int) {
/**
 * A police officer needs to check the license and speed of a driver. Complete the code to check the following:
 *
 * 1. If the license is valid, print "License is valid," otherwise, print "License is invalid."
 * 2. If the speed is less than or equal to 60, print "Driver is within speed limit."
 *    If the speed is between 61 and 80 (inclusive), print "Driver is speeding."
 *    If the speed is greater than 80, print "Driver is overspeeding! Take appropriate action."
 *    Note: Only print about the speed if the license is valid.
 *
 * @param license True if license is valid, False otherwise
 * @param speed the speed of the driver
 */
fun checkLicenseAndSpeeding(license: Boolean, speed: Int) {

    if (license) {
        // Enter your code here to check the speed within the given conditions
        when {
            speed <= 60 -> println("Driver is within speed limit.")
            speed in 61..80 -> println("Driver is speeding.")
            else -> println("Driver is overspeeding! Take appropriate action.")
        }
    } else {
        println("License is invalid.")
    }
}