Question
c++ program Details: Each node's data consists of id number (an integer), Name (a string), three test scores all are of the same type (all
c++ program
Details:
Each node's data consists of id number (an integer), Name (a string), three test scores all are of the same type (all are: integers, floats or doubles). The data files is to be used as test data.
The program must load the data from the file and place it in the linked list in ascending order (that is lowest to highest) based on the id number. Use class templates to accommodate test scores that are integer, float or double.
Define the linkedlist class in a header file and the methods that will maintain the list in a C++ implementation file.
Each Node of the list contains the data specified above, and a pointer to the next node. Define the Node class in a header file. Methods that will maintain the Node 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. Choose to define a child class that inherits the Node class or may use object composition.
Methods in the classes may include but are not limited to the following:
Add is a method that adds a Node at its appropriate position.
Print method that prints the Node data to a file. All nodes that are created using the new operator must be de-allocated, deleted.
Average is a method that calculates the average (average is not a data member).
Grade is a method that calculates the grade (grade is not a data member).
Other functions may be used such as getData(), setNext()
Requirements:
A static data member that keeps track of the number of nodes in the list.
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.
file 21169 Conner, Laurel 77.5 88.5 99.5 24085 Santos, Maria 85.2 57.9 69.8 281393 Czerepak, Margert 90.1 83.1 95.1 27276 Elborki, Rochel 45.5 65 80.7 19959 Gutierez, Florene 90.3 57.5 88.2 25610 Huatuco, Nicholas 35.5 65.0 56.0 24679 Lopez, Deetta 68.0 87.5 56.9 27081 Majlik, Trent 99.2 77.2 22.2 114757 Patience, Van 82.0 99.6 95.5 27079 Ned, Timika 48.0 99.0 70.0 19328 Canales, Linn 75.3 75.6 75.9 25283 Saim, Malik 44.0 66.0 90.0 25628 Laflamme, Mara 73.1 83.4 93.4 27685 Hilton, Blythe 66 86 96 28055 Oliphant, Hollie 55.5 95 88
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started