Question: Given a class diagram for List as in Figure 1. Complete a linked list program given in Program 1. Define List class and write the

 Given a class diagram for List as in Figure 1. Completea linked list program given in Program 1. Define List class andwrite the implementation for all the function members for List to accomplisheach of the following tasks: List -head: ItemNode* - tail: Item Node*+ task1(Item Node*): void + task2(Item Node*): void + task3(): void +task4(Item Node*, int): void + task5(int): void + task6(): void Figure 1:List class 1 2 3 4 5 6 7 //Program 1 classItemNode { public: string name; float price; ItemNode *aft, *bef; ItemNode (string

Given a class diagram for List as in Figure 1. Complete a linked list program given in Program 1. Define List class and write the implementation for all the function members for List to accomplish each of the following tasks: List -head: ItemNode* - tail: Item Node* + task1(Item Node*): void + task2(Item Node*): void + task3(): void + task4(Item Node*, int): void + task5(int): void + task6(): void Figure 1: List class 1 2 3 4 5 6 7 //Program 1 class ItemNode { public: string name; float price; ItemNode *aft, *bef; ItemNode (string n=NULL, float p=0) { name = n; price = p; aft = NULL; bef = NULL; } }; 8 9 10 11 12 13 14 15 16 17 18 int main() { List ItemList; ItemNode *n1 = new ItemNode ("Book", 9.59); ItemNode *n2 = new ItemNode ("Ruler", 3.45); ItemNode *n3 = new ItemNode ("Pen", 5.69); ItemNode *n4 = new ItemNode ("Eraser", 2.25); 19 20 21 22 23 24 25 26 27 cout fixed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!