Question: c the leader of a scout troop has a program...
The leader of a scout troop has a program that members use to manage cookie sales. Members enter their orders into the program and it generates a file listing each customer’s name, the number of cookie types ordered, then for each type ordered, the number of boxes and cookie name. The first two records of a sample file are shown below:
1 Thin Mint
2 Carmel Delite
2 Carmel Delite
Write a program that will process this file, reading the file name from the user, and then creating a linked list with records containing the following information, ordered alphabetically by cookie name.
CookieNode * next;
After processing the file, your program should display a menu that allows the user to choose one of the following options:
- Print Ordering Summary
- Print List
Each option is explained below:
- Print Ordering Summary: Displays a table. Each line contains a cookie name followed by a single number stating the total number of boxes of that cookie type that must be ordered to fill all orders in the list. The cookie names must appear in alphabetical order.
- Print List: Displays the linked list as a table with the data for each node on a separate line. Give the cookie name, number of boxes, and customer name for each node.
- Exit: Exits the program
Your program must continue to display the menu and process selections as stated above until the user chooses to exit the program.
Write a class named CookieList that contains a linked list of the CookieNode structures given above. Your class should include a constructor and destructor along with methods to insert a node and display the list.
Write a class named CookieFile that contains methods to read the file, print the ordering summary, and print the list. This class will include a CookieList member variable. The methods in this class will invoke the operations in the CookieList class as necessary.
Store your class declarations and member functions in separate files named with the class name and the appropriate extension (.h or .cpp).