/**
 * Calculate the population density based on the given population and land area.
 *
 * @param population The total population of an area.
 * @param landArea The total area of land in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculateDensity(population: Int, landArea: Float): Float? {

    // Calculate the population density using the conditional ternary operator
    val density = if (population > 0 && landArea > 0) population / landArea else null

    return density
}
/**
 * Calculate the population density based on the given population and land area.
 *
 * @param population The total population of an area.
 * @param landArea The total area of land in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculateDensity(population: Int, landArea: Float): Float? {
/**
 * Calculate the population density based on the given population and land area.
 *
 * @param population The total population of an area.
 * @param landArea The total area of land in square kilometers.
 * @return The population density in individuals per square kilometer.
 */
fun calculateDensity(population: Int, landArea: Float): Float? {

    // Calculate the population density using the conditional ternary operator
    val density = if (population > 0 && landArea > 0) population / landArea else null

    return density
}