Question: undefined 1 #include 2 #include 3 using namespace::std; 4 5 class Employee 6 7 public: 8 long int Employee ID; 9 int hours; 10 double

undefined 1 #include 2 #include 3 using namespace::std; 4 5 class Employee6 7 public: 8 long int Employee ID; 9 int hours; 10double payrate; 11 double wages; 12 13 Employee* next; 14 15 16Employee (long int id) 17 { 18 this->EmployeeID = id; 19 nextundefined

1 #include 2 #include 3 using namespace::std; 4 5 class Employee 6 7 public: 8 long int Employee ID; 9 int hours; 10 double payrate; 11 double wages; 12 13 Employee* next; 14 15 16 Employee (long int id) 17 { 18 this->EmployeeID = id; 19 next = NULL; 20 } 21 }; 22 23 24 class list 25 26 private: 27 Employee* head; 28 Employee* tail; 29 30 31 public: 32 list() 33 { 34 head = tail = NULL; 35 } 36 37 void AddEmployee(Employee* E) 38 { 39 40 if(head==NULL) 41 { 42 head = E; 43 tail = E; 44 } 45 else 46 { 47 tail->next = E; 48 tail = E; 49 } 50 } 51 52 void get Information() 53 { 54 if(head!=NULL) 55 { 56 57 Employee* curr = head; 58 59 coutEmployee ID>curr->hours; 70 71 72 73 74 75 76 77 while(curr->hours>curr->hours; } cout>curr->payrate; 78 79 80 81 82 83 84 85 86 while(curr->payrate>curr->payrate; } 87 88 curr->wages = curr->hours*curr->payrate; curr= curr->next; 89 90 91 92 93 94 } else { coutEmployeeID; coutwagesnext; } } 115 116 117 118 }; 119 121 int main() 122 { 123 124 125 list *L = new list(); 126 127 128 long int id; 129 int size; 130 131 cout>size; 133 134 // This is for adding employees to the list 135 // I add 3 employee to the list but you can add any number of employee 136 for(int i=0; i>id; 140 L->Add Employee(new Employee(id)); 141 } 142 143 144 // You can add employee by this method without for loop 145 // L->Add Employee (new Employee(4444)); 146 // L->AddEmployee(new Employee (5555)); 147 // L->AddEmployee (new Employee( 6666)); 148 // L->AddEmployee (new Employee( 7777)); 149 150 L->getInformation(); 151 L->displayWages(); 152 153 154 } 155 Link Reverse: Modify the linked list class you created in the previous assignments by adding a member function named reverse that rearranges the nodes in the list so their order is reversed. Print for confirmation. Link - Insertion by Position: Modify the list class by adding a member function for inserting a new item at a specified position. A position of O means that the value will become the first item on the list, a position of 1 means the value will become the second item on the list and so on. A position equal to or greater than the length of the list means the value is placed at the end of the list

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!