Question: Question 3 Example Main Function: int main() { struct Recipe rl = create(); char ingredient_list (1120) = { flour, water, yeas sugar); Not yet answered

 Question 3 Example Main Function: int main() { struct Recipe rl

Question 3 Example Main Function: int main() { struct Recipe rl = create(); char ingredient_list (1120) = { "flour", "water", "yeas "sugar"); Not yet answered Marked out of 40.00 a) Write a recipe structure which has the following attributes; Float measurements list [20] = {2.5, 1.2, 1, 2); name: name of the recipe, maximum of 50 characters recipe_id: ID of the recipe ing number: number of ingredients ingredients: 2D character array containing ing number of strings measurements: float array, contains measurements of the given ingredients, has one on one correspondence and the same order if (canMake (ri, ingredient_list, measurements_list, 4)) printf("You can make ts", rl.name); else printf("You cannot make ts", ri.name); return 0; b) Write a create() function which inputs the necessary attributes of a recipe and returns a Recipe structure. 1 c) Write a canMake() function which takes a Recipe structure, a 2D char array which contains ingredients a person has, a float array containing the amount of ingredients a person has, and the number of ingredients a person has. Returns 1 if the person has enough ingredients to make the recipe, else returns 0. Sample Run: Recipe Name: Bread Recipe ID: 536 Number of ingredients: 3 Ingredient #1: water Measurement (cups) of the ingredient #1: 1.1 Ingredient #2: flour Example Main Function: nt mais) struct Recipe ri - create() Measurement (cups) of the ingredient #2: 2 DIE FRO 9 ] o Prisc 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!