An array of structures is needed to keep track of 50 grocery items containing the item name,
Question:
struct grocery
{char name[20], type[15];
float cost, taxp;
int quan;}
Also, the following declaration has been done in the main: grocery g[50];
a. Write a program fragment to load the array of structures from a text file called ITEMS.TXT. Assume that for each grocery item, the first line of the text file only contains the item name, the second line of the text file contains only the item type, and the third line of the text file contains the cost, quantity, and tax percentage. No declarations or functions are needed.
b. Sort the structures on the cost data member in DESCENDING order. No declarations, functions, or print routine are needed.
c. Save your structure to the binary file ITEMS.BIN. No declarations or functions are needed.
Applied Physics
ISBN: 978-0132109277
10th Edition
Authors: Dale ewen, Neill schurter, P. erik gundersen