Question: IN C++ USING THIS CODE: #include #include #include #include #include #include #include // PLACE PROTOTYPES HERE FOR TASK E // ************************************************* //--------------------------------------------------------------------- // Employee class

IN C++ USING THIS CODE:
#include
// PLACE PROTOTYPES HERE FOR TASK E // ************************************************* //--------------------------------------------------------------------- // Employee class definition class Employee { public: Employee() { firstName = " "; lastName = " "; } // Employee constructor initializes the three data members Employee(std::string first, std::string last, int salary) : firstName{first}, lastName{last} { if (salary >= 0) { // if salary is valid monthlySalary = salary; // set monthlySalary to salary } }
// set first name void setFirstName(const std::string &); // return first name std::string getFirstName(); // set last name void setLastName(const std::string &); // return last name std::string getLastName(); // set monthly salary; if not positive, set to 0 void setMonthlySalary(int); // return monthly salary int getMonthlySalary();
private: std::string firstName; // Employee's first name std::string lastName; // Employee's last name int monthlySalary{0}; // Employee's salary per month };
using std::cout; using std::cin; using std::endl; using std::setw; using std::left; using std::right;
void taskE() { myLList list; // Append some values to the list. cout
cout
cout
// PLACE CODE HERE FOR TASK E // ************************************************* // TASK E CODE // Employee class methods // set first name void Employee::setFirstName(const std::string &name) { firstName = name; // no validation needed } // return first name std::string Employee::getFirstName() { return firstName; } // set last name void Employee::setLastName(const std::string &name) { lastName = name; // no validation needed } // return last name std::string Employee::getLastName() { return lastName; } // set monthly salary; if not positive, set to 0 void Employee::setMonthlySalary(int salary) { if (salary >= 0) { // if salary is valid monthlySalary = salary; // set monthlySalary to salary } if (salary For the task, we will design an ascending order arranged linked list class. This linked list class should hold a series of Employee objects. The linked list class should have member functions for displaying, appending, inserting, and deleting nodes. Also, it will need a destructor that destroys the list. For this assignment, the Employee class and all of the methods have been provided for you. You will obviously interface with them in your linked list code. Do not incorporate or hard code anything other than the parameters and data type (Employee) into your linked list class. Note we could attempt a more generic version of the linked list class by use of templates, but that would also make this a longer engagement than desired... For this assignment, you will need to provide these public member functions that perform the following tasks: a) appendNode appends a node containing employee info, to the end of the list. The method supports either an Employee object or the Employee member values passed as arguments. See the myCodeDos for a concrete example. b) insertNode this function inserts a node with the employee info logically into the list. This function must insert based on the last name values in ascending order. So, the list is ordered by last name, lexicographically, with duplicates permitted. The method supports either an Employee object or the Employee member values passed as arguments. See the myCodeDos for a concrete example. c) deleteNode this function searches for a node with last name as its parameter's value as the element to find. The node, if found, is deleted from the list and from memory. If two or more nodes with the same value are found, only one is removed (your choice which one). If none are found, no action is taken. d) displaylist this function traverses through the linked list and produces output as follows: Appending to the list Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Sally Sea 22250 Zippy Zip 150 Now inserting into the list Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Estoy Rico 75000 Sally Sea 22250 Chuck Ster 5050 Zippy Zip 150 Now the reduction in force Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Estoy Rico 75000 Sally Sea 22250 Chuck Ster 5050 For the task, we will design an ascending order arranged linked list class. This linked list class should hold a series of Employee objects. The linked list class should have member functions for displaying, appending, inserting, and deleting nodes. Also, it will need a destructor that destroys the list. For this assignment, the Employee class and all of the methods have been provided for you. You will obviously interface with them in your linked list code. Do not incorporate or hard code anything other than the parameters and data type (Employee) into your linked list class. Note we could attempt a more generic version of the linked list class by use of templates, but that would also make this a longer engagement than desired... For this assignment, you will need to provide these public member functions that perform the following tasks: a) appendNode appends a node containing employee info, to the end of the list. The method supports either an Employee object or the Employee member values passed as arguments. See the myCodeDos for a concrete example. b) insertNode this function inserts a node with the employee info logically into the list. This function must insert based on the last name values in ascending order. So, the list is ordered by last name, lexicographically, with duplicates permitted. The method supports either an Employee object or the Employee member values passed as arguments. See the myCodeDos for a concrete example. c) deleteNode this function searches for a node with last name as its parameter's value as the element to find. The node, if found, is deleted from the list and from memory. If two or more nodes with the same value are found, only one is removed (your choice which one). If none are found, no action is taken. d) displaylist this function traverses through the linked list and produces output as follows: Appending to the list Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Sally Sea 22250 Zippy Zip 150 Now inserting into the list Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Estoy Rico 75000 Sally Sea 22250 Chuck Ster 5050 Zippy Zip 150 Now the reduction in force Lisa Able 4500 Mark Cork 4000 Yoo Hoo 720 Boo Hoo 16060 Estoy Rico 75000 Sally Sea 22250 Chuck Ster 5050
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
