/**
 * A photographer charges a certain amount per photo taken.
 * The calculateCost function takes in the number of photos taken and the cost per photo,
 * and returns the total cost of the session.
 *
 * @param numPhotos an integer representing the number of photos taken
 * @param costPerPhoto a floating point number representing the cost per photo
 * @return totalCost a floating point number representing the total cost of the session
 */
fun calculateCost(numPhotos: Int, costPerPhoto: Double): Double {

    var totalCost = 0.0

    while (true) {
        try {
            print("Please enter the number of photos taken: ")
            val numPhotosInput = readLine()!!.toInt()

            print("Please enter the cost per photo: ")
            val costPerPhotoInput = readLine()!!.toDouble()

            totalCost = numPhotosInput * costPerPhotoInput
            break
        } catch (e: NumberFormatException) {
            println("Invalid input. Please enter a valid number.")
        }
    }

    return totalCost
}
/**
 * A photographer charges a certain amount per photo taken.
 * The calculateCost function takes in the number of photos taken and the cost per photo,
 * and returns the total cost of the session.
 *
 * @param numPhotos an integer representing the number of photos taken
 * @param costPerPhoto a floating point number representing the cost per photo
 * @return totalCost a floating point number representing the total cost of the session
 */
fun calculateCost(numPhotos: Int, costPerPhoto: Double): Double {
/**
 * A photographer charges a certain amount per photo taken.
 * The calculateCost function takes in the number of photos taken and the cost per photo,
 * and returns the total cost of the session.
 *
 * @param numPhotos an integer representing the number of photos taken
 * @param costPerPhoto a floating point number representing the cost per photo
 * @return totalCost a floating point number representing the total cost of the session
 */
fun calculateCost(numPhotos: Int, costPerPhoto: Double): Double {

    var totalCost = 0.0

    while (true) {
        try {
            print("Please enter the number of photos taken: ")
            val numPhotosInput = readLine()!!.toInt()

            print("Please enter the cost per photo: ")
            val costPerPhotoInput = readLine()!!.toDouble()

            totalCost = numPhotosInput * costPerPhotoInput
            break
        } catch (e: NumberFormatException) {
            println("Invalid input. Please enter a valid number.")
        }
    }

    return totalCost
}