Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Define and implement the LinkedList class template in the file LinkedList.cpp . Please read the comments carefully and implement the class template. The main function

Define and implement the LinkedList class template in the file LinkedList.cpp. Please read the comments carefully and implement the
class template.
The main function is contained in the file lab05.cpp. The main function contains the following 3 parts.
A. Part 1:
Declares a linked list which stores integers.
Prompts user to enter int values and push these values in the linked list, stop adding the values when the user enter 0.
Prints the size of the linked list.
Prints the values in the linked list.
Prompts user to enter a value key, and find if key is in the linked list.
Prompts user to enter k(the number of values to be removed), and remove k values from the front.
Prints the values stored in the linked list.
B. Part 2:
Declares a linked list which stores strings.
Prompts user to enter strings and add these strings in the linked list, stop adding the strings when the user enters "exit".
Prints the size of the linked list.
Prints the strings in the linked list.
Prompts user to enter k(the number of strings to be removed), and remove k strings from the front.
Prints the strings stored in the linked list.
C. Part 3:
Declares a linked list which stores employees (click download Employee.cpp darr ).
Prompts user to enter employee's id, name, and department name, and add the employees in the linked list, stop adding when the user enters id as 0.
Prints the size of the linked list.
Prints the employees in the linked list.
Prompts user to enter k(the number of employees to be removed), and remove k employees from the front.
Prints the employees stored in the linked list.
The expected result:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions