Question: Insert Table Chart Text Shape Media Comment Description: For this assignment, you are going to write an ordered linked list to implement a grocery list.
Insert Table Chart Text Shape Media Comment Description: For this assignment, you are going to write an ordered linked list to implement a grocery list. You will ask the user for information and modify the list as the user indicates. All of the information will be written to a file. Just as in the first program, you are to check to see if the file exists. If it does, open the file and populate the list. When the program terminates, print the information to a file. Call the file grocerylist.txt.The first entry in the list is to be the number in the list. You will modify the Node class that you wrote in the last program. You will create a structure that contains the main data and the Node class will contain a variable of that structure and the link. You will write an ordered link list class that will insert, delete, traverse, and retrieve items from the list. The list will be ordered on the UPC code. You will not enter duplicate items. If the item already exists, then you need to indicate that to the user and not enter it in the list. Structure data: UPC code-number of the item ltem description - description of item that must be able to include spaces Quantity-number of item to purchase Cost-cost per item Aisle -number of aisle at store Node class data: Structure - will be a declaration of the structure defined above - the information of the structure must be private to the class, but can be returned from the class. Link-pointer to next item in the list Node class member functions Default constructor Constructor that takes UPC, item, quantity, cost, and aisle Mutator function to set next pointer Accessor function to return next pointer Accessor function to return UPC code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
