Question
Responsible for creating OrderedList.cpp PLEASE NEED HELP! Orderlist.h File provided: #ifndef _ORDERED_LIST_GUARD #define _ORDERED_LIST_GUARD 1 #define _ARRAY_LIST_MAX_NUM_OF_NODES 100 #include Student.h using namespace std; class OrderedList
Responsible for creating OrderedList.cpp PLEASE NEED HELP!
Orderlist.h File provided:
#ifndef _ORDERED_LIST_GUARD
#define _ORDERED_LIST_GUARD 1
#define _ARRAY_LIST_MAX_NUM_OF_NODES 100
#include "Student.h"
using namespace std;
class OrderedList
{
private:
int length; // number of items currently in the list
Student nodes[_ARRAY_LIST_MAX_NUM_OF_NODES]; // place where the list is stored
public:
/* constructer */
OrderedList();// { length = 0; }
/* destructer */
~OrderedList();
int getLength();// { return length; }
bool remove(string lastName, string firstName);
/* If target item exists in list, remove it, decrement length, and return true
* otherwise, return false */
bool insert(Student newItem);
/* If new item exists in list, or list is full, return false
* otherwise, add item to list, increment length, and return true */
Student *search(string lastName, string firstName);
/* If target exists in list, return pointer to the target
* otherwise, return null
* */
void traverse(void);
/* For each student, print the student's order, name, and letter grade in the following format:
* order
*
* For example, the second student in the roster, whose name is
* Bridgett Avendado and whose grade is D would appear as follows:
* 2. Avendano, Bridgett - D
*
* The students are listed in lexicographical order by their last name,
* with 2 or more students having the same last name being listed in
* lexicographical order by their first name.
* */
void traverseByGrade(void);
/* This functions is similar to the traverse function, except that the
* students are listed in order by their grade, with the highest
* grade appearing first and the lowest grade appearing last.
*
* This is accomplished by sorting the list of nodes by their grade,
* traversing the list, and then sorting the list by their last and
* first names again.
* */
void traverseOut(ofstream *f, double hwWeight, double qzWeight, double fxWeight);
/* The file *f should already be open prior to calling traverseOut.
*
* First, output to *f the weights and number of students, then for each student,
* output the student's name, homework grades, quiz grades, and test grade to *f.
* */
};
#endif
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