/**
 * A geologist wants to calculate the percentage of the grain size difference 
 * between two diameter measurements. The formula to calculate the percentage 
 * is: difference_in_size = (diameter1 - diameter2) and percentage = (difference_in_size / diameter1) * 100.
 * 
 * Complete the code to calculate the percentage of the grain size difference using the given formula.
 * Round the resulting percentage to two decimal places.
 * 
 * @param diameter1 The first diameter measurement.
 * @param diameter2 The second diameter measurement.
 * @return The percentage of the grain size difference rounded to two decimal places.
 */
fun calculateGrainSizePercentage(diameter1: Double, diameter2: Double): Double {

    // Calculate the difference in size between the two diameters
    val differenceInSize = diameter1 - diameter2

    // Calculate the percentage of the grain size difference
    var percentage = (differenceInSize / diameter1) * 100

    // Round the resulting percentage to two decimal places
    percentage = String.format("%.2f", percentage).toDouble()

    return percentage
}
/**
 * A geologist wants to calculate the percentage of the grain size difference 
 * between two diameter measurements. The formula to calculate the percentage 
 * is: difference_in_size = (diameter1 - diameter2) and percentage = (difference_in_size / diameter1) * 100.
 * 
 * Complete the code to calculate the percentage of the grain size difference using the given formula.
 * Round the resulting percentage to two decimal places.
 * 
 * @param diameter1 The first diameter measurement.
 * @param diameter2 The second diameter measurement.
 * @return The percentage of the grain size difference rounded to two decimal places.
 */
fun calculateGrainSizePercentage(diameter1: Double, diameter2: Double): Double {
/**
 * A geologist wants to calculate the percentage of the grain size difference 
 * between two diameter measurements. The formula to calculate the percentage 
 * is: difference_in_size = (diameter1 - diameter2) and percentage = (difference_in_size / diameter1) * 100.
 * 
 * Complete the code to calculate the percentage of the grain size difference using the given formula.
 * Round the resulting percentage to two decimal places.
 * 
 * @param diameter1 The first diameter measurement.
 * @param diameter2 The second diameter measurement.
 * @return The percentage of the grain size difference rounded to two decimal places.
 */
fun calculateGrainSizePercentage(diameter1: Double, diameter2: Double): Double {

    // Calculate the difference in size between the two diameters
    val differenceInSize = diameter1 - diameter2

    // Calculate the percentage of the grain size difference
    var percentage = (differenceInSize / diameter1) * 100

    // Round the resulting percentage to two decimal places
    percentage = String.format("%.2f", percentage).toDouble()

    return percentage
}