Question: Create a script ingredient _ cost . m that: Prompts the user to input the cost of each ingredient and the quantity required for a
Create a script ingredientcostm that:
Prompts the user to input the cost of each ingredient and the quantity required for a recipe.
Uses a while loop to allow the user to add as many ingredients as they like.
Outputs the total cost using fprintf in a formatted way.
Use a while loop that continues asking for more ingredients until the user indicates they are done.
Example interaction: Enter the cost of the ingredient: Enter the quantity required: Would
you like to add another ingredient? yn: y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
