Question: studentRoll.h #ifndef STUDENTROLL_H #define STUDENTROLL_H #include #include student.h class StudentRoll { public: StudentRoll(); void insertAtTail(const Student &s); std::string toString() const; StudentRoll(const StudentRoll &orig); ~StudentRoll(); StudentRoll

studentRoll.h

#ifndef STUDENTROLL_H

#define STUDENTROLL_H

#include

#include "student.h"

class StudentRoll {

public:

StudentRoll();

void insertAtTail(const Student &s);

std::string toString() const;

StudentRoll(const StudentRoll &orig);

~StudentRoll();

StudentRoll & operator=(const StudentRoll &right);

private:

struct Node {

Student *s;

Node *next;

};

Node *head;

Node *tail;

};

#endif

studentRoll.cpp

#include

#include "studentRoll.h"

StudentRoll::StudentRoll() {

head = tail = NULL;

}

void StudentRoll::insertAtTail(const Student &s) {

}

std::string StudentRoll::toString() const {

}

StudentRoll::StudentRoll(const StudentRoll &orig) {

head = tail = NULL;

}

StudentRoll::~StudentRoll() {

}

StudentRoll & StudentRoll::operator =(const StudentRoll &right ) {

// The next two lines are standard, and you should keep them.

// They avoid problems with self-assignment where you might free up

// memory before you copy from it. (e.g. x = x)

if (&right == this)

return (*this);

// TODO... Here is where there is code missing that you need to

// fill in...

// KEEP THE CODE BELOW THIS LINE

// Overloaded = should end with this line, despite what the textbook says.

return (*this);

}

studentRoll.h #ifndef STUDENTROLL_H #define STUDENTROLL_H #include #include "student.h" class StudentRoll { public:StudentRoll(); void insertAtTail(const Student &s); std::string toString() const; StudentRoll(const StudentRoll &orig); ~StudentRoll();StudentRoll & operator=(const StudentRoll &right); private: struct Node { Student *s; Node

use the header file to implement the functions in the cpp file in order to pass the 3 tests provided! Use basic c++ and you can only include whatever is given in the files! thank you!

test studentRoll01.cpp #include student .hu #include "studentRoll hit #include kios tream #include "tddFuncs.h" using name space std; int main cout Running tests from FILE endl Student s Phill Conrad 1234567) ASSERT EQUALS Phill Conrad rs getName()); ASSERT EQUALS (1234567, s.get rm Student Roll sri ASSERT EQUALS sr. to String sr. insert AtTail (s) ASSERT EQUALs [[Phill Conrad, 12345671) sr.tostring setName "Chris Gaucho"); s set Perm (2222222) s .getName()) ASSERT EQUALS Chris Gaucho sr. insert AtTail(s): ASSERT EQUALs [Phill Conrad, 1234567], Chris Gauch 222222211", sr. t return 0 test studentRoll01.cpp #include student .hu #include "studentRoll hit #include kios tream #include "tddFuncs.h" using name space std; int main cout Running tests from FILE endl Student s Phill Conrad 1234567) ASSERT EQUALS Phill Conrad rs getName()); ASSERT EQUALS (1234567, s.get rm Student Roll sri ASSERT EQUALS sr. to String sr. insert AtTail (s) ASSERT EQUALs [[Phill Conrad, 12345671) sr.tostring setName "Chris Gaucho"); s set Perm (2222222) s .getName()) ASSERT EQUALS Chris Gaucho sr. insert AtTail(s): ASSERT EQUALs [Phill Conrad, 1234567], Chris Gauch 222222211", sr. t return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!