Question: I need help with location, remove and peek function. I'm not able to think of any logic that I can implement. Objective: The purpose of
I need help with location, remove and peek function. I'm not able to think of any logic that I can implement.
Objective:
The purpose of this project is to expose you to:
Applying analysis, design and implementation of a linked list using dynamic data structure, discrete methods such as recursion are utilized in solution, objects classes are used in constructing a multi file project. RAM organization and the use of thispointer to accomplish tasks; in addition to using referenced parameters as constant, all methods are implemented in a procedure like programming to implement class objects and operations.
.
Problem Specification:
You are to submit the analysis, design and implementation of a bag that maintains an ordered linked list.
Details:
Each nodes data consists of: id number (5 digits), Name (a string), and hours & rate both are of the same type (both are: integers, floats or doubles). This data is provided in the attached file. Your program must read the data from either one of the files and place it in the linked list in descending order (that is highest to lowest) based on the id number.
Each Node of the list contains the data above, and a pointer to the next node. You are to define the Node class in a header file. Methods that will maintain the list are stored in a C++ implementation file.
The client C++ file will contain code that interacts with the user using a menu like interface to test operations on the sorted list. You may choose to define a child class that inherits the Node class or may use object composition. However, every class must have two files a header and an implementation.
Methods may include but are not limited to the following:
Addis a method that adds a Node at its appropriate position.
Locationis a method that returns a pointer to where action may take place. (Recursive)
Removeis a method that removes a selected Node if it exists, returns true or false.
Clearis a method that clears the list of all the Nodes, but before a Node is deleted, it calls aprintmethod that prints the Node data to a file. All nodes that are created using the new operator must be de-allocated, deleted.
Peek isan accessor method that displays, on the screen, the data in the Node given the students name, if the Node with name does not exist the method will display that. The list is unchanged.
Grossis a method that calculates the gross (gross is not a data member).
Netis a method that calculates the net after taking 20% taxes (net is not a data member).
Other functions may be used such asgetData(), setNext() as explained in the book and in previous projects.
Requirements:
Specify each methods purpose, describe its parameters, and write a pseudo-code version of its header as explained in book.
A static data member that keeps track of the number of nodes in the list.
Create a UML class diagram for all classes.
Use class templates to accommodate employees payroll data that are integer, float and double.
Create a header file and implementation file for the bag.
Create a header file that contains the class declaration for the class Node. Each node contains data and a pointer to the next node. The last nodes next field should always be NULL.
Create an implementation file that contains the methods for each class.
Define a default constructor that initializes the head pointer to NULL.
Define a destructor, may be virtual, if deleting nodes is done in other methods.
Define a method to determine if the listisEmpty.
Use guards against duplication of #include.
Create as many .h header files as needed and write your own .cpp file that is a driver containing a menu like choices to drive the project. Loading the list is not a menu option, its done automatically.
text file Data1.txt (is as below)
21169 Ahmed, Marco 40 10 24085 ATamimi, Trevone 30 15 281393 Choudhury, Jacob 45 12 27276 De la Cruz, Edward 30 17 19959 Edwards, Faraj 90 5 25610 Edwards, Bill 17 22 24679 Gallimore, Christian 28 14 27081 Lopez, Luis 45 5 114757 Mora, Sam 23 8 27079 Moses, Samuel 48 10 19328 Perez, Albert 57 2 25283 Rivas, Jonathan 44 12 25628 Robinson, Albert 33 3 27685 Miranda, Michael 60 12 28055 Robinson, Iris 55 9
Step by Step Solution
There are 3 Steps involved in it
This question is complete Lets walk through locations remove and peek methods implemented in an ordered linked list Solution Outline The task involves ... View full answer
Get step-by-step solutions from verified subject matter experts
