Question: im learning C language Define a struct data type namely Product with three elements id, name, price (int, string, int), and another struct data type
im learning C language

Define a struct data type namely Product with three elements id, name, price (int, string, int), and another struct data type namely ProductList which consist of an array of 4 products. a) Create a product list, and ask the user to input info for its products in the order of id name price together. Then print out the product of smallest price among non-fruit products (id >200 ). The program must work exactly as below: Enter product info: 123 green apple 30 Enter product info: 124 red apple 35 Enter product info: 235 organic brown rice 40 Enter product info: 248 honey bbq sauce 25 Cheapest non-fruit product: ID=248, NAME = honey bbq sauce, PRICE =25 Note: when user input, there could be many blank spaces before and after id name price information. However, assume that there are no redundant spaces between words in the name. b) Ask the user to contimuously select purchase products by entering exact id or a part of name to search. Print out an error message if it does not match any product or match more than one. The program stops when user input 0 , and prints out the total bill value (sum of all purchase products' prices). It must work exactly as below. Enter purchase product (ID/ NAME): 235 > Added to the bill: ID=235, NAME = organic brown rice, PRICE=40 Enter purchase product (ID/ NAME): apple > Matched multiple ones. Please provide more accurate ID/NAME Enter purchase product (ID/ NAME): 0 ** Your total BILL is 40 Note: Assume that the user enters input in proper way (with no redundant spaces)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
