(Program must be in C++)
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 “this”
pointer 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 node’s data consists of: id number (5 digits), Name
(string), and hours & rate both are of the same type (both are:
integers, floats or doubles). Two sets of data are provided in the
attached files.
Your program must load the data from the first file and place it
in a linked list, data is organized in descending order (that is
highest to lowest) based on the id number as it is being loaded.,
do the same thing for the second file.
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,
and the methods that will maintain the list 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:
Add is a method that allows the user to add a Node at its
appropriate position.
Location is a method that returns a pointer to where action may
take place. (Recursive)
Remove is a method that removes a selected Node if it exists,
returns true or false.
Clear is a method that clears the list of all the Nodes, but
before a Node is deleted, it calls a print method that prints the
Node data to a file. All nodes that are created using the new
operator must be de-allocated, deleted.
Peek is an 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.
getGross is a private method that calculates and returns the
gross (gross is not a data member).
getNet is a private method that calculates and returns the net
after taking 20% taxes (net is not a data member).
Other functions may be used such as getData(), setNext() … as
explained in the book and in previous projects.
Requirements:
Specify an abstract class to be used as a bag interface class.
Each method specification include its purpose, its parameters,
returned value and referenced parameters, as explained in the
book.
A static data member that keeps track of the number of nodes in
the list.
Create a UML class diagram for each of the
classes.
Use templates to accommodate employee’s 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 node’s 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 list isEmpty.
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, it’s done
automatically.
Grading Criteria:
5 points
Good programming practices: Proper spacing, comments, use of
variables, indentations and appearance of program.
5 points
Default constructors and destructors are defined and performs
their tasks.
5 points
A abstract base class, Bag-interface, with all absolute virtual
methods is included.
5 points
CRC card is submitted.
5 points
Class diagrams are submitted and are correct.
5 points
Each class’s header file contains the class definition and
guards.
5 points
Implementation file for each header containing the functions
implementations.
5 points
Multi file project is used to accomplish task.
10 points
Templates are used properly to allow two lists with different
data types.
5 points
Accessor methods are constants and parameters passed are also
constants
5 points
The this pointer is used to access member data.
5 points
At least one recursive function is used.
15 points
All methods above are clearly defined and self-contained.
15 points
Program solution fits specifications.
5 points
Contents of all files are submitted.
(Program must be in C++) Objective: The purpose of this project is to expose you to: Applying analysis, design and imple
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am