/**
 * This function takes a recipe map, ingredient name, and a new ingredient as input.
 * It replaces the existing ingredient with the new ingredient in the recipe map.
 *
 * @param recipe A map representing a recipe.
 * @param ingredientName The name of the ingredient to be modified.
 * @param newIngredient The new ingredient to replace the existing ingredient.
 * @return The modified recipe map.
 */
fun modifyRecipe(recipe: MutableMap<String, String>, ingredientName: String, newIngredient: String): MutableMap<String, String> {

    if (ingredientName in recipe) {
        recipe[ingredientName] = newIngredient
    }
    return recipe
}

// Task 1: Create a recipe map for a Tomato Soup with the following ingredients and quantities:
// - Tomatoes: 4
// - Onion: 1
// - Garlic: 3 cloves
// - Salt: 1 teaspoon
// - Pepper: 1/2 teaspoon
val recipe = mutableMapOf(
    "Tomatoes" to "4",
    "Onion" to "1",
    "Garlic" to "3 cloves",
    "Salt" to "1 teaspoon",
    "Pepper" to "1/2 teaspoon"
)
/**
 * This function takes a recipe map, ingredient name, and a new ingredient as input.
 * It replaces the existing ingredient with the new ingredient in the recipe map.
 *
 * @param recipe A map representing a recipe.
 * @param ingredientName The name of the ingredient to be modified.
 * @param newIngredient The new ingredient to replace the existing ingredient.
 * @return The modified recipe map.
 */
fun modifyRecipe(recipe: MutableMap<String, String>, ingredientName: String, newIngredient: String): MutableMap<String, String> {
/**
 * This function takes a recipe map, ingredient name, and a new ingredient as input.
 * It replaces the existing ingredient with the new ingredient in the recipe map.
 *
 * @param recipe A map representing a recipe.
 * @param ingredientName The name of the ingredient to be modified.
 * @param newIngredient The new ingredient to replace the existing ingredient.
 * @return The modified recipe map.
 */
fun modifyRecipe(recipe: MutableMap<String, String>, ingredientName: String, newIngredient: String): MutableMap<String, String> {

    if (ingredientName in recipe) {
        recipe[ingredientName] = newIngredient
    }
    return recipe
}

// Task 1: Create a recipe map for a Tomato Soup with the following ingredients and quantities:
// - Tomatoes: 4
// - Onion: 1
// - Garlic: 3 cloves
// - Salt: 1 teaspoon
// - Pepper: 1/2 teaspoon
val recipe = mutableMapOf(
    "Tomatoes" to "4",
    "Onion" to "1",
    "Garlic" to "3 cloves",
    "Salt" to "1 teaspoon",
    "Pepper" to "1/2 teaspoon"
)