/**
 * This function calculates the volume of water in a reservoir based on its area, average depth, rainfall, and evaporation.
 *
 * @param reservoirArea The surface area of the reservoir in square kilometers.
 * @param averageDepth The average depth of the reservoir in meters.
 * @param rainfall The amount of rainfall in millimeters.
 * @param evaporation The amount of water evaporated from the reservoir in millimeters.
 * @return The volume of water in the reservoir in cubic meters.
 */
fun calculateVolumeOfWaterInReservoir(reservoirArea: Double, averageDepth: Double, rainfall: Double, evaporation: Double): Double {

    val surfaceArea = reservoirArea * 1000000  // Conversion from square kilometers to square meters
    var volume = surfaceArea * averageDepth  // Calculate volume in cubic meters

    // Subtract the amount of water evaporated
    volume -= (surfaceArea * evaporation)

    // Add the amount of rainfall
    volume += (surfaceArea * rainfall)

    return volume
}
/**
 * This function calculates the volume of water in a reservoir based on its area, average depth, rainfall, and evaporation.
 *
 * @param reservoirArea The surface area of the reservoir in square kilometers.
 * @param averageDepth The average depth of the reservoir in meters.
 * @param rainfall The amount of rainfall in millimeters.
 * @param evaporation The amount of water evaporated from the reservoir in millimeters.
 * @return The volume of water in the reservoir in cubic meters.
 */
fun calculateVolumeOfWaterInReservoir(reservoirArea: Double, averageDepth: Double, rainfall: Double, evaporation: Double): Double {
/**
 * This function calculates the volume of water in a reservoir based on its area, average depth, rainfall, and evaporation.
 *
 * @param reservoirArea The surface area of the reservoir in square kilometers.
 * @param averageDepth The average depth of the reservoir in meters.
 * @param rainfall The amount of rainfall in millimeters.
 * @param evaporation The amount of water evaporated from the reservoir in millimeters.
 * @return The volume of water in the reservoir in cubic meters.
 */
fun calculateVolumeOfWaterInReservoir(reservoirArea: Double, averageDepth: Double, rainfall: Double, evaporation: Double): Double {

    val surfaceArea = reservoirArea * 1000000  // Conversion from square kilometers to square meters
    var volume = surfaceArea * averageDepth  // Calculate volume in cubic meters

    // Subtract the amount of water evaporated
    volume -= (surfaceArea * evaporation)

    // Add the amount of rainfall
    volume += (surfaceArea * rainfall)

    return volume
}