(Solved) : Include Using Namespace Std Include Include Listh List List Head 0 List List Node Currnod Q36161195 . . .
#include <iostream>
using namespace std;
#include <string>
#include “List.h”
List::List() : head(0) {}
List::~List()
{
Node* currNode = head;
Node* nextNode;
while (currNode != NULL) {
nextNode = currNode->next;
delete currNode->data;
delete currNode;
currNode = nextNode;
}
}
void List::add(Course* ca)
{
Node* tmpNode;
Node* currNode;
Node* prevNode;
tmpNode = new Node;
tmpNode->data = ca;
tmpNode->next = 0;
currNode = head;
prevNode = NULL;
while (currNode != NULL) {
if (ca->lessThan(currNode->data))
break;
prevNode = currNode;
currNode = currNode->next;
}
if (prevNode == NULL) {
head = tmpNode;
}
else {
prevNode->next = tmpNode;
}
tmpNode->next = currNode;
}
void List::print()
{
Node* currNode = head;
while (currNode != NULL) {
currNode->data->print();
currNode = currNode->next;
}
}
float List::computeGPA(){
//return getGrade()/getNumCourses();
}
int List::computeNumFW(){
// if(getGrade()<=0){
// return
}
}
Contro rn – term Vieu read Stuld godeint8, inst + mainMou in selectia int) 10 2. Modify the List class You will need to use a collection class for each student object to store course objects or object pointers. If you did not implement the List class in a previous assignment, you can adapt the Array class from the tutorials. COMP 2404Winter 2019 Assignment #3 1/5 To prepare your program to work with the new Monitor classes, you will make the following changes to your List class (or Array, if you don’t have a List class): implement the computeGPA ) function that returns the average of all course grades (between 0 and 12) for the student, excluding the withdrawals; you will use the function prototype: float computeGPA ) . implement the computeNumFW () function that returns the number of courses that the student has failed or from which the student has withdrawn; you will use the function prototype: int computeNumPW ) : Show transcribed image text
Expert Answer
Answer to Include Using Namespace Std Include Include Listh List List Head 0 List List Node Currnod Q36161195 . . .
OR