Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 = 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started