/**
 * Calculate the population density for a given population and area.
 *
 * @param population Total population of an area in square kilometers.
 * @param area The total area in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculatePopulationDensity(population: Int, area: Float): Float? {

    var populationDensity: Float? = null

    // Check if the population and area are valid
    if (population > 0 && area > 0) {
        // Calculate the population density
        populationDensity = population.toFloat() / area
    } else {
        // Print an error message
        println("Invalid population or area values!")
    }

    return populationDensity
}
/**
 * Calculate the population density for a given population and area.
 *
 * @param population Total population of an area in square kilometers.
 * @param area The total area in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculatePopulationDensity(population: Int, area: Float): Float? {
/**
 * Calculate the population density for a given population and area.
 *
 * @param population Total population of an area in square kilometers.
 * @param area The total area in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculatePopulationDensity(population: Int, area: Float): Float? {

    var populationDensity: Float? = null

    // Check if the population and area are valid
    if (population > 0 && area > 0) {
        // Calculate the population density
        populationDensity = population.toFloat() / area
    } else {
        // Print an error message
        println("Invalid population or area values!")
    }

    return populationDensity
}