SlideShare a Scribd company logo
1 of 34
Download to read offline
#ifndef COURSES_H
#define COURSES_H
class Courses
{
private:
struct CourseList
{
char courseNum[10];
char courseName[25];
char courseSch[20];
CourseList *next;
};
CourseList *head;
void displayArrayChar(char [], int);
public:
Courses(void)
{head=NULL;}
~Courses(void);
void appendCourse(char [],char [], char []);
void appendCourse(CourseList *);
void deleteCourse(char []);
bool searchforCourse(char []);
void displayAllCourses(void);
void editCourses(char [], char [], int );
void emptyCourses(void); //function called when a student is deleted
CourseList* getHead(void){return head;}
//friend void StudentInfo::insertStudent(char [], char [], int [], CourseList *);
};
#endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//studentinfo.h
#ifndef STUDENTINFO_H
#define STUDENTINFO_H
#include
#include "Courses.h"
using namespace std;
class StudentInfo
{
private:
struct StudentList
{
char firstName[12];
char lastName[12];
int ssn[9];
Courses studentCourses;
struct StudentList *next;
};
StudentList *ssnhead;
int tempStoreSSN[9];
void displayArrayChar(char [], int);
void displayArrayInt(int []);
bool testIntArray(int [], int []);
public:
StudentInfo(void)
{ssnhead=NULL;}
~StudentInfo(void);
void insertStudent(char [], char [], int [], Courses &);
void insertStudent(char fn[], char ln[], int s[]);
void deleteStudent(int []);
bool searchBylast(char []);
bool searchByssn(int []);
void displayAllStudents(void);
void editStudentInfo(int []);
void editStudentInfo(char [],int);
int getTempssn(int);
void storessnTemp(char [], int);
};
#endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//courses.cpp
#include
#include
#include
#include "courses.h"
#include "studentinfo.h"
using namespace std;
Courses::~Courses(void)
{
CourseList *nodePtr, *nextNode;
nodePtr=head;
while (nodePtr !=NULL)
{
nextNode=nodePtr->next;
delete nodePtr;
nodePtr=nextNode;
}
head=NULL;
}
void Courses::appendCourse(CourseList *tempHead) //should only pass the head pointer of the
node
{
CourseList *nodePtr, *nodeTempPtr, *newNode;
nodePtr=head;
nodeTempPtr=nodePtr;
while(nodeTempPtr->next !=NULL)
{nodePtr=nodePtr->next;
}
nodeTempPtr = tempHead;
while(nodeTempPtr->next !=NULL)
{
newNode=new CourseList;
strcpy(newNode->courseNum, nodeTempPtr->courseNum);
strcpy(newNode->courseName, nodeTempPtr->courseName);
strcpy(newNode->courseSch, nodeTempPtr->courseSch);
newNode->next=NULL;
nodePtr->next=newNode;
nodePtr=nodePtr->next;
nodeTempPtr=nodeTempPtr->next;
}
}
void Courses::appendCourse(char cNum[], char cName[], char cSch[])
{
CourseList *newNode, *nodePtr;
newNode=new CourseList;
strcpy(newNode->courseNum, cNum);
strcpy(newNode->courseName, cName);
strcpy(newNode->courseSch, cSch);
newNode->next=NULL;
if(!head)
head=newNode;
else
{
nodePtr=head;
while(nodePtr->next)
{
nodePtr=nodePtr->next;
}
nodePtr->next=newNode;
}
}
void Courses::emptyCourses(void)
{
CourseList *nodePtr, *nextNode;
nodePtr=head;
while (nodePtr !=NULL)
{
nextNode=nodePtr->next;
delete nodePtr;
nodePtr=nextNode;
}
head=NULL;
}
void Courses::displayAllCourses(void)
{
CourseList *nodePtr;
nodePtr=head;
if(!head)
cout<< " This Student isn't registered for any classes ";
while(nodePtr)
{
displayArrayChar(nodePtr->courseNum, 10);
cout<< " ";
displayArrayChar(nodePtr->courseName, strlen(nodePtr->courseName));
cout<< " ";
displayArrayChar(nodePtr->courseSch, strlen(nodePtr->courseSch));
cout<<" ";
nodePtr=nodePtr->next;
}
}
void Courses::displayArrayChar(char array[], int elms)
{
for(int counter=0; counter < elms; counter++)
{
cout<< array[counter];
}
}
void Courses::deleteCourse(char array[])
{
CourseList *nodePtr, *previousNode;
head->courseNum[10]=NULL; //THE FUNCTION WON'T WORK W/O THIS
if(!head)
return;
if(strcmp(head->courseNum, array) == 0)
{
nodePtr=head->next;
delete head;
head=nodePtr;
}
else
{
nodePtr=head;
while(nodePtr->next !=NULL && strcmp(array, nodePtr->courseNum) !=0)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
previousNode->next=nodePtr->next;
delete nodePtr;
}
}
bool Courses::searchforCourse(char array[])
{
CourseList *nodePtr;
if(!head)
return false;
if(strcmp(head->courseNum, array) == 0)
return true;
else
{
nodePtr=head;
while(nodePtr !=NULL && strcmp(nodePtr->courseNum, array) !=0)
{
if(strcmp(nodePtr->courseNum, array) ==0)
return true;
nodePtr=nodePtr->next;
}
return false;
}
}
void Courses::editCourses(char course[], char change[], int choice)
{
CourseList *nodePtr;
nodePtr=head;
head->courseNum[1]=NULL; //THE FUNCTION WON'T WORK WITHOUT THIS
if(strcmp(head->courseNum, course) == 0);
else
{
while(nodePtr->next !=NULL && strcmp(course, nodePtr->courseNum) !=0)
{
nodePtr=nodePtr->next;
}
}
switch(choice)
{
case 1://Changes the Course Number
strcpy(nodePtr->courseNum, change);
break;
case 2://Changes the Course Name
strcpy(nodePtr->courseName, change);
break;
case 3://Changes the Course Schedule
strcpy(nodePtr->courseSch, change);
break;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Studentinfo.cpp
#include
#include
#include
#include
#include "studentinfo.h"
#include "courses.h"
using namespace std;
StudentInfo::~StudentInfo(void)
{
StudentList *nodePtr, *nextNode;
nodePtr=ssnhead;
while(nodePtr !=NULL)
{
nextNode=nodePtr->next;
ssnhead->next->studentCourses.emptyCourses();
delete nodePtr;
nodePtr=nextNode;
}
ssnhead->next=NULL;
}
void StudentInfo::insertStudent(char fn[], char ln[], int s[], Courses &stdcourses)
{
StudentList *newNode, *nodePtr, *previousNode;
newNode=new StudentList;
strcpy(newNode->firstName, fn);
strcpy(newNode->lastName, ln);
for(int count=0; count<9; count++)
newNode->ssn[count]=s[count];
newNode->studentCourses.appendCourse(stdcourses.getHead());
newNode->next=NULL;
if(ssnhead==NULL) //There should be no information stored in the head
{
ssnhead=newNode;
}
else
{
nodePtr= ssnhead;
while(nodePtr !=NULL)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
if(previousNode==NULL)
{
ssnhead->next=newNode; //There should be no information stored in the head
newNode->next=nodePtr;
}
else
{
previousNode->next=newNode;
newNode->next=nodePtr;
}
}
}
void StudentInfo::insertStudent(char fn[], char ln[], int s[])
{
StudentList *newNode, *nodePtr, *previousNode;
newNode=new StudentList;
strcpy(newNode->firstName, fn);
strcpy(newNode->lastName, ln);
for(int count=0; count<9; count++)
newNode->ssn[count]=s[count];
if(ssnhead==NULL)
{
ssnhead->next=newNode;
newNode->next=NULL;
}
else
{
nodePtr=ssnhead;
while(nodePtr !=NULL)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
if(previousNode==NULL)
{
ssnhead=newNode;
newNode->next=nodePtr;
}
else
{
previousNode->next=newNode;
newNode->next=nodePtr;
}
}
}
void StudentInfo::deleteStudent(int s[])
{
StudentList *nodePtr, *previousNode;
if(s[0] ==-1)
{
for(int c=0; c<10; c++)
s[c]=tempStoreSSN[c];
tempStoreSSN[0]=NULL;
}
if(!ssnhead->next)
return;
if(testIntArray(ssnhead->next->ssn, s) == true)
{
nodePtr = ssnhead->next->next;
ssnhead->next->studentCourses.emptyCourses();
delete ssnhead->next;
ssnhead->next=nodePtr;
}
else
{
nodePtr=ssnhead->next;
while(nodePtr !=NULL && testIntArray(ssnhead->next->ssn, s) != true)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
previousNode->next=nodePtr->next;
ssnhead->next->studentCourses.emptyCourses();
delete nodePtr;
}
}
void StudentInfo::displayArrayChar(char array[], int elms)
{
for(int counter=0; counter< elms; counter++)
{
cout<< array[counter];
}
}
void StudentInfo::displayArrayInt(int array[])
{
for(int counter = 0; counter<9; counter++)
{
cout<< array[counter];
}
}
void StudentInfo::displayAllStudents()
{
StudentList *nodePtr;
nodePtr = ssnhead;
if(ssnhead==NULL)
{
cout<< " There aren't any students in the database. ";
return;
}
while(nodePtr)
{
cout << " made it in" << endl;
cout<< " ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName));
cout<< " ";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName));
cout<< " ";
displayArrayInt(nodePtr->ssn);
cout<< " ";
nodePtr->studentCourses.displayAllCourses();
cout<< endl;
}
}
bool StudentInfo::searchBylast(char name[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
int temp=0;
if(nodePtr==NULL)
return false;
while(nodePtr !=NULL)
{
if(strcmp(name, nodePtr->lastName) == 0)
{
cout<< endl<< (temp + 1)<< "-";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< ", ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl;
temp++;
}
if(nodePtr==NULL && temp !=0)
{
return true;
}
nodePtr=nodePtr->next;
}
return false;
}
bool StudentInfo::searchByssn(int social[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
if(nodePtr==NULL)
return false;
while(nodePtr !=NULL)
{
if(testIntArray(social, nodePtr->ssn) == true)
{
cout<< " ";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout << ", ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl;
return true;
}
nodePtr=nodePtr->next;
}
return false;
}
void StudentInfo::storessnTemp(char name[], int count)
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
int counter=1;
while(nodePtr !=NULL)
{
if(strcmp(name, nodePtr->lastName) == 0)
{
if(counter == count)
{
for(int c=0; c<9; c++)
tempStoreSSN[c] = nodePtr->ssn[c];
}
else
counter++;
}
nodePtr= nodePtr->next;
}
}
int StudentInfo::getTempssn(int e)
{
return tempStoreSSN[e];
}
void StudentInfo::editStudentInfo(char futurechange[], int choice)
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
while(nodePtr !=NULL && testIntArray(tempStoreSSN, nodePtr->ssn) == true)
{
nodePtr=nodePtr->next;
}
switch(choice)
{
case 1://Changes first name
strcpy(nodePtr->firstName, futurechange);
break;
case 2://Changes last name
strcpy(nodePtr->lastName, futurechange);
break;
}
}
void StudentInfo::editStudentInfo(int futurechange[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
while(testIntArray(tempStoreSSN, nodePtr->ssn) ==true && nodePtr !=NULL)
{
nodePtr=nodePtr->next;
}
for(int count = 0; count<9; count++)
nodePtr->ssn[count]=futurechange[count];
}
bool StudentInfo::testIntArray(int a[], int b[])
{
for(int count=0; count<9; count++)
{
if(a[count] != b[count])
return false;
}
return true;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//mainprogram.cpp
#include
#include
#include
#include
#include "studentinfo.h"
#include "courses.h"
#define ERROR " You've Entered An Invalid Character! "
void displayname(void);
void getStudentInfo(StudentInfo &);
bool changeCase(char [], int);
void getCourseInfo(Courses &);
bool yesorno(void);
int mainMenu(void);
void directions(void);
Solution
#ifndef COURSES_H
#define COURSES_H
class Courses
{
private:
struct CourseList
{
char courseNum[10];
char courseName[25];
char courseSch[20];
CourseList *next;
};
CourseList *head;
void displayArrayChar(char [], int);
public:
Courses(void)
{head=NULL;}
~Courses(void);
void appendCourse(char [],char [], char []);
void appendCourse(CourseList *);
void deleteCourse(char []);
bool searchforCourse(char []);
void displayAllCourses(void);
void editCourses(char [], char [], int );
void emptyCourses(void); //function called when a student is deleted
CourseList* getHead(void){return head;}
//friend void StudentInfo::insertStudent(char [], char [], int [], CourseList *);
};
#endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//studentinfo.h
#ifndef STUDENTINFO_H
#define STUDENTINFO_H
#include
#include "Courses.h"
using namespace std;
class StudentInfo
{
private:
struct StudentList
{
char firstName[12];
char lastName[12];
int ssn[9];
Courses studentCourses;
struct StudentList *next;
};
StudentList *ssnhead;
int tempStoreSSN[9];
void displayArrayChar(char [], int);
void displayArrayInt(int []);
bool testIntArray(int [], int []);
public:
StudentInfo(void)
{ssnhead=NULL;}
~StudentInfo(void);
void insertStudent(char [], char [], int [], Courses &);
void insertStudent(char fn[], char ln[], int s[]);
void deleteStudent(int []);
bool searchBylast(char []);
bool searchByssn(int []);
void displayAllStudents(void);
void editStudentInfo(int []);
void editStudentInfo(char [],int);
int getTempssn(int);
void storessnTemp(char [], int);
};
#endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//courses.cpp
#include
#include
#include
#include "courses.h"
#include "studentinfo.h"
using namespace std;
Courses::~Courses(void)
{
CourseList *nodePtr, *nextNode;
nodePtr=head;
while (nodePtr !=NULL)
{
nextNode=nodePtr->next;
delete nodePtr;
nodePtr=nextNode;
}
head=NULL;
}
void Courses::appendCourse(CourseList *tempHead) //should only pass the head pointer of the
node
{
CourseList *nodePtr, *nodeTempPtr, *newNode;
nodePtr=head;
nodeTempPtr=nodePtr;
while(nodeTempPtr->next !=NULL)
{nodePtr=nodePtr->next;
}
nodeTempPtr = tempHead;
while(nodeTempPtr->next !=NULL)
{
newNode=new CourseList;
strcpy(newNode->courseNum, nodeTempPtr->courseNum);
strcpy(newNode->courseName, nodeTempPtr->courseName);
strcpy(newNode->courseSch, nodeTempPtr->courseSch);
newNode->next=NULL;
nodePtr->next=newNode;
nodePtr=nodePtr->next;
nodeTempPtr=nodeTempPtr->next;
}
}
void Courses::appendCourse(char cNum[], char cName[], char cSch[])
{
CourseList *newNode, *nodePtr;
newNode=new CourseList;
strcpy(newNode->courseNum, cNum);
strcpy(newNode->courseName, cName);
strcpy(newNode->courseSch, cSch);
newNode->next=NULL;
if(!head)
head=newNode;
else
{
nodePtr=head;
while(nodePtr->next)
{
nodePtr=nodePtr->next;
}
nodePtr->next=newNode;
}
}
void Courses::emptyCourses(void)
{
CourseList *nodePtr, *nextNode;
nodePtr=head;
while (nodePtr !=NULL)
{
nextNode=nodePtr->next;
delete nodePtr;
nodePtr=nextNode;
}
head=NULL;
}
void Courses::displayAllCourses(void)
{
CourseList *nodePtr;
nodePtr=head;
if(!head)
cout<< " This Student isn't registered for any classes ";
while(nodePtr)
{
displayArrayChar(nodePtr->courseNum, 10);
cout<< " ";
displayArrayChar(nodePtr->courseName, strlen(nodePtr->courseName));
cout<< " ";
displayArrayChar(nodePtr->courseSch, strlen(nodePtr->courseSch));
cout<<" ";
nodePtr=nodePtr->next;
}
}
void Courses::displayArrayChar(char array[], int elms)
{
for(int counter=0; counter < elms; counter++)
{
cout<< array[counter];
}
}
void Courses::deleteCourse(char array[])
{
CourseList *nodePtr, *previousNode;
head->courseNum[10]=NULL; //THE FUNCTION WON'T WORK W/O THIS
if(!head)
return;
if(strcmp(head->courseNum, array) == 0)
{
nodePtr=head->next;
delete head;
head=nodePtr;
}
else
{
nodePtr=head;
while(nodePtr->next !=NULL && strcmp(array, nodePtr->courseNum) !=0)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
previousNode->next=nodePtr->next;
delete nodePtr;
}
}
bool Courses::searchforCourse(char array[])
{
CourseList *nodePtr;
if(!head)
return false;
if(strcmp(head->courseNum, array) == 0)
return true;
else
{
nodePtr=head;
while(nodePtr !=NULL && strcmp(nodePtr->courseNum, array) !=0)
{
if(strcmp(nodePtr->courseNum, array) ==0)
return true;
nodePtr=nodePtr->next;
}
return false;
}
}
void Courses::editCourses(char course[], char change[], int choice)
{
CourseList *nodePtr;
nodePtr=head;
head->courseNum[1]=NULL; //THE FUNCTION WON'T WORK WITHOUT THIS
if(strcmp(head->courseNum, course) == 0);
else
{
while(nodePtr->next !=NULL && strcmp(course, nodePtr->courseNum) !=0)
{
nodePtr=nodePtr->next;
}
}
switch(choice)
{
case 1://Changes the Course Number
strcpy(nodePtr->courseNum, change);
break;
case 2://Changes the Course Name
strcpy(nodePtr->courseName, change);
break;
case 3://Changes the Course Schedule
strcpy(nodePtr->courseSch, change);
break;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Studentinfo.cpp
#include
#include
#include
#include
#include "studentinfo.h"
#include "courses.h"
using namespace std;
StudentInfo::~StudentInfo(void)
{
StudentList *nodePtr, *nextNode;
nodePtr=ssnhead;
while(nodePtr !=NULL)
{
nextNode=nodePtr->next;
ssnhead->next->studentCourses.emptyCourses();
delete nodePtr;
nodePtr=nextNode;
}
ssnhead->next=NULL;
}
void StudentInfo::insertStudent(char fn[], char ln[], int s[], Courses &stdcourses)
{
StudentList *newNode, *nodePtr, *previousNode;
newNode=new StudentList;
strcpy(newNode->firstName, fn);
strcpy(newNode->lastName, ln);
for(int count=0; count<9; count++)
newNode->ssn[count]=s[count];
newNode->studentCourses.appendCourse(stdcourses.getHead());
newNode->next=NULL;
if(ssnhead==NULL) //There should be no information stored in the head
{
ssnhead=newNode;
}
else
{
nodePtr= ssnhead;
while(nodePtr !=NULL)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
if(previousNode==NULL)
{
ssnhead->next=newNode; //There should be no information stored in the head
newNode->next=nodePtr;
}
else
{
previousNode->next=newNode;
newNode->next=nodePtr;
}
}
}
void StudentInfo::insertStudent(char fn[], char ln[], int s[])
{
StudentList *newNode, *nodePtr, *previousNode;
newNode=new StudentList;
strcpy(newNode->firstName, fn);
strcpy(newNode->lastName, ln);
for(int count=0; count<9; count++)
newNode->ssn[count]=s[count];
if(ssnhead==NULL)
{
ssnhead->next=newNode;
newNode->next=NULL;
}
else
{
nodePtr=ssnhead;
while(nodePtr !=NULL)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
if(previousNode==NULL)
{
ssnhead=newNode;
newNode->next=nodePtr;
}
else
{
previousNode->next=newNode;
newNode->next=nodePtr;
}
}
}
void StudentInfo::deleteStudent(int s[])
{
StudentList *nodePtr, *previousNode;
if(s[0] ==-1)
{
for(int c=0; c<10; c++)
s[c]=tempStoreSSN[c];
tempStoreSSN[0]=NULL;
}
if(!ssnhead->next)
return;
if(testIntArray(ssnhead->next->ssn, s) == true)
{
nodePtr = ssnhead->next->next;
ssnhead->next->studentCourses.emptyCourses();
delete ssnhead->next;
ssnhead->next=nodePtr;
}
else
{
nodePtr=ssnhead->next;
while(nodePtr !=NULL && testIntArray(ssnhead->next->ssn, s) != true)
{
previousNode=nodePtr;
nodePtr=nodePtr->next;
}
previousNode->next=nodePtr->next;
ssnhead->next->studentCourses.emptyCourses();
delete nodePtr;
}
}
void StudentInfo::displayArrayChar(char array[], int elms)
{
for(int counter=0; counter< elms; counter++)
{
cout<< array[counter];
}
}
void StudentInfo::displayArrayInt(int array[])
{
for(int counter = 0; counter<9; counter++)
{
cout<< array[counter];
}
}
void StudentInfo::displayAllStudents()
{
StudentList *nodePtr;
nodePtr = ssnhead;
if(ssnhead==NULL)
{
cout<< " There aren't any students in the database. ";
return;
}
while(nodePtr)
{
cout << " made it in" << endl;
cout<< " ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName));
cout<< " ";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName));
cout<< " ";
displayArrayInt(nodePtr->ssn);
cout<< " ";
nodePtr->studentCourses.displayAllCourses();
cout<< endl;
}
}
bool StudentInfo::searchBylast(char name[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
int temp=0;
if(nodePtr==NULL)
return false;
while(nodePtr !=NULL)
{
if(strcmp(name, nodePtr->lastName) == 0)
{
cout<< endl<< (temp + 1)<< "-";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< ", ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl;
temp++;
}
if(nodePtr==NULL && temp !=0)
{
return true;
}
nodePtr=nodePtr->next;
}
return false;
}
bool StudentInfo::searchByssn(int social[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
if(nodePtr==NULL)
return false;
while(nodePtr !=NULL)
{
if(testIntArray(social, nodePtr->ssn) == true)
{
cout<< " ";
displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout << ", ";
displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl;
return true;
}
nodePtr=nodePtr->next;
}
return false;
}
void StudentInfo::storessnTemp(char name[], int count)
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
int counter=1;
while(nodePtr !=NULL)
{
if(strcmp(name, nodePtr->lastName) == 0)
{
if(counter == count)
{
for(int c=0; c<9; c++)
tempStoreSSN[c] = nodePtr->ssn[c];
}
else
counter++;
}
nodePtr= nodePtr->next;
}
}
int StudentInfo::getTempssn(int e)
{
return tempStoreSSN[e];
}
void StudentInfo::editStudentInfo(char futurechange[], int choice)
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
while(nodePtr !=NULL && testIntArray(tempStoreSSN, nodePtr->ssn) == true)
{
nodePtr=nodePtr->next;
}
switch(choice)
{
case 1://Changes first name
strcpy(nodePtr->firstName, futurechange);
break;
case 2://Changes last name
strcpy(nodePtr->lastName, futurechange);
break;
}
}
void StudentInfo::editStudentInfo(int futurechange[])
{
StudentList *nodePtr;
nodePtr=ssnhead->next;
while(testIntArray(tempStoreSSN, nodePtr->ssn) ==true && nodePtr !=NULL)
{
nodePtr=nodePtr->next;
}
for(int count = 0; count<9; count++)
nodePtr->ssn[count]=futurechange[count];
}
bool StudentInfo::testIntArray(int a[], int b[])
{
for(int count=0; count<9; count++)
{
if(a[count] != b[count])
return false;
}
return true;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//mainprogram.cpp
#include
#include
#include
#include
#include "studentinfo.h"
#include "courses.h"
#define ERROR " You've Entered An Invalid Character! "
void displayname(void);
void getStudentInfo(StudentInfo &);
bool changeCase(char [], int);
void getCourseInfo(Courses &);
bool yesorno(void);
int mainMenu(void);
void directions(void);

More Related Content

Similar to #ifndef COURSES_H #define COURSES_H class Courses { privat.pdf

Write a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfWrite a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfjillisacebi75827
 
Inheritance in C++.ppt
Inheritance in C++.pptInheritance in C++.ppt
Inheritance in C++.pptinstaface
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancjiJakub Marchwicki
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
Starting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfStarting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfaptind
 
how do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdfhow do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdffootwearpark
 
C++ QUICK REFERENCE.pdf
C++ QUICK REFERENCE.pdfC++ QUICK REFERENCE.pdf
C++ QUICK REFERENCE.pdffqerwqdfad
 
CppQuickRef.pdf
CppQuickRef.pdfCppQuickRef.pdf
CppQuickRef.pdfkurimaru1
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfamarndsons
 
My question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdfMy question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdfjeetumordhani
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Andrey Akinshin
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
Table.java Huffman code frequency tableimport java.io.;im.docx
 Table.java Huffman code frequency tableimport java.io.;im.docx Table.java Huffman code frequency tableimport java.io.;im.docx
Table.java Huffman code frequency tableimport java.io.;im.docxMARRY7
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 

Similar to #ifndef COURSES_H #define COURSES_H class Courses { privat.pdf (20)

Write a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfWrite a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdf
 
Inheritance in C++.ppt
Inheritance in C++.pptInheritance in C++.ppt
Inheritance in C++.ppt
 
Mapeamento uml java
Mapeamento uml javaMapeamento uml java
Mapeamento uml java
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji
 
DS Code (CWH).docx
DS Code (CWH).docxDS Code (CWH).docx
DS Code (CWH).docx
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Starting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfStarting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdf
 
how do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdfhow do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdf
 
C++ QUICK REFERENCE.pdf
C++ QUICK REFERENCE.pdfC++ QUICK REFERENCE.pdf
C++ QUICK REFERENCE.pdf
 
CppQuickRef.pdf
CppQuickRef.pdfCppQuickRef.pdf
CppQuickRef.pdf
 
oop objects_classes
oop objects_classesoop objects_classes
oop objects_classes
 
OOP Lab Report.docx
OOP Lab Report.docxOOP Lab Report.docx
OOP Lab Report.docx
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdf
 
My question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdfMy question is pretty simple, I just want to know how to call my ope.pdf
My question is pretty simple, I just want to know how to call my ope.pdf
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Table.java Huffman code frequency tableimport java.io.;im.docx
 Table.java Huffman code frequency tableimport java.io.;im.docx Table.java Huffman code frequency tableimport java.io.;im.docx
Table.java Huffman code frequency tableimport java.io.;im.docx
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
C++ programs
C++ programsC++ programs
C++ programs
 
Java Concepts
Java ConceptsJava Concepts
Java Concepts
 

More from anupambedcovers

1). The inheritance of recessive genes (disease causing) can remain .pdf
1). The inheritance of recessive genes (disease causing) can remain .pdf1). The inheritance of recessive genes (disease causing) can remain .pdf
1). The inheritance of recessive genes (disease causing) can remain .pdfanupambedcovers
 
$ 90.08WorkingStep-1Monthly Payment CalculationMonhly Payment=L.pdf
$ 90.08WorkingStep-1Monthly Payment  CalculationMonhly Payment=L.pdf$ 90.08WorkingStep-1Monthly Payment  CalculationMonhly Payment=L.pdf
$ 90.08WorkingStep-1Monthly Payment CalculationMonhly Payment=L.pdfanupambedcovers
 
C++ Program to Implement Singly Linked List #includei.pdf
  C++ Program to Implement Singly Linked List  #includei.pdf  C++ Program to Implement Singly Linked List  #includei.pdf
C++ Program to Implement Singly Linked List #includei.pdfanupambedcovers
 
Long term Expected return of the Stock return ty.pdf
           Long term Expected return of the Stock            return ty.pdf           Long term Expected return of the Stock            return ty.pdf
Long term Expected return of the Stock return ty.pdfanupambedcovers
 
The English word chemistry has a few senses .pdf
                     The English word chemistry has a few senses .pdf                     The English word chemistry has a few senses .pdf
The English word chemistry has a few senses .pdfanupambedcovers
 
since it is (1)^infinity form ...... we get it b.pdf
                     since it is (1)^infinity form ......  we get it b.pdf                     since it is (1)^infinity form ......  we get it b.pdf
since it is (1)^infinity form ...... we get it b.pdfanupambedcovers
 
yes as NAI is ionic in nature water disolves ion.pdf
                     yes  as NAI is ionic in nature water disolves ion.pdf                     yes  as NAI is ionic in nature water disolves ion.pdf
yes as NAI is ionic in nature water disolves ion.pdfanupambedcovers
 
Mg(0H)2 as there is ionic between Mg & OH and co.pdf
                     Mg(0H)2 as there is ionic between Mg & OH  and co.pdf                     Mg(0H)2 as there is ionic between Mg & OH  and co.pdf
Mg(0H)2 as there is ionic between Mg & OH and co.pdfanupambedcovers
 
It depends on how many unique protons are adjacen.pdf
                     It depends on how many unique protons are adjacen.pdf                     It depends on how many unique protons are adjacen.pdf
It depends on how many unique protons are adjacen.pdfanupambedcovers
 
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdf
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdfx = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdf
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdfanupambedcovers
 
Option B. ie More than one theseSolutionOption B. ie More than.pdf
Option B. ie More than one theseSolutionOption B. ie More than.pdfOption B. ie More than one theseSolutionOption B. ie More than.pdf
Option B. ie More than one theseSolutionOption B. ie More than.pdfanupambedcovers
 
When two genes are located on the same chromosome they are called as.pdf
When two genes are located on the same chromosome they are called as.pdfWhen two genes are located on the same chromosome they are called as.pdf
When two genes are located on the same chromosome they are called as.pdfanupambedcovers
 
We have layered model used in network design since these layers grou.pdf
We have layered model used in network design since these layers grou.pdfWe have layered model used in network design since these layers grou.pdf
We have layered model used in network design since these layers grou.pdfanupambedcovers
 
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdf
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdfThe half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdf
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdfanupambedcovers
 
The answer is CH2Since moles = massmolar massMoles of C H = .pdf
The answer is CH2Since moles = massmolar massMoles of C  H = .pdfThe answer is CH2Since moles = massmolar massMoles of C  H = .pdf
The answer is CH2Since moles = massmolar massMoles of C H = .pdfanupambedcovers
 
SolutionFICASocial Security withheld taxMedicre tax withheldRates.pdf
SolutionFICASocial  Security withheld taxMedicre tax  withheldRates.pdfSolutionFICASocial  Security withheld taxMedicre tax  withheldRates.pdf
SolutionFICASocial Security withheld taxMedicre tax withheldRates.pdfanupambedcovers
 
Since HCL is a strong acid we can assume that it will fulyy ionise.pdf
Since HCL is a strong acid we can assume that it will fulyy ionise.pdfSince HCL is a strong acid we can assume that it will fulyy ionise.pdf
Since HCL is a strong acid we can assume that it will fulyy ionise.pdfanupambedcovers
 
d) Peptide Note that forming a peptide bond resu.pdf
                     d) Peptide  Note that forming a peptide bond resu.pdf                     d) Peptide  Note that forming a peptide bond resu.pdf
d) Peptide Note that forming a peptide bond resu.pdfanupambedcovers
 
Security has been the number 1 issue for any IT industry and organiz.pdf
Security has been the number 1 issue for any IT industry and organiz.pdfSecurity has been the number 1 issue for any IT industry and organiz.pdf
Security has been the number 1 issue for any IT industry and organiz.pdfanupambedcovers
 
P.E = - k e2 rnP.E in nth orbit is UnP.E is inversely propotio.pdf
P.E = - k e2  rnP.E in nth orbit is UnP.E is inversely propotio.pdfP.E = - k e2  rnP.E in nth orbit is UnP.E is inversely propotio.pdf
P.E = - k e2 rnP.E in nth orbit is UnP.E is inversely propotio.pdfanupambedcovers
 

More from anupambedcovers (20)

1). The inheritance of recessive genes (disease causing) can remain .pdf
1). The inheritance of recessive genes (disease causing) can remain .pdf1). The inheritance of recessive genes (disease causing) can remain .pdf
1). The inheritance of recessive genes (disease causing) can remain .pdf
 
$ 90.08WorkingStep-1Monthly Payment CalculationMonhly Payment=L.pdf
$ 90.08WorkingStep-1Monthly Payment  CalculationMonhly Payment=L.pdf$ 90.08WorkingStep-1Monthly Payment  CalculationMonhly Payment=L.pdf
$ 90.08WorkingStep-1Monthly Payment CalculationMonhly Payment=L.pdf
 
C++ Program to Implement Singly Linked List #includei.pdf
  C++ Program to Implement Singly Linked List  #includei.pdf  C++ Program to Implement Singly Linked List  #includei.pdf
C++ Program to Implement Singly Linked List #includei.pdf
 
Long term Expected return of the Stock return ty.pdf
           Long term Expected return of the Stock            return ty.pdf           Long term Expected return of the Stock            return ty.pdf
Long term Expected return of the Stock return ty.pdf
 
The English word chemistry has a few senses .pdf
                     The English word chemistry has a few senses .pdf                     The English word chemistry has a few senses .pdf
The English word chemistry has a few senses .pdf
 
since it is (1)^infinity form ...... we get it b.pdf
                     since it is (1)^infinity form ......  we get it b.pdf                     since it is (1)^infinity form ......  we get it b.pdf
since it is (1)^infinity form ...... we get it b.pdf
 
yes as NAI is ionic in nature water disolves ion.pdf
                     yes  as NAI is ionic in nature water disolves ion.pdf                     yes  as NAI is ionic in nature water disolves ion.pdf
yes as NAI is ionic in nature water disolves ion.pdf
 
Mg(0H)2 as there is ionic between Mg & OH and co.pdf
                     Mg(0H)2 as there is ionic between Mg & OH  and co.pdf                     Mg(0H)2 as there is ionic between Mg & OH  and co.pdf
Mg(0H)2 as there is ionic between Mg & OH and co.pdf
 
It depends on how many unique protons are adjacen.pdf
                     It depends on how many unique protons are adjacen.pdf                     It depends on how many unique protons are adjacen.pdf
It depends on how many unique protons are adjacen.pdf
 
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdf
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdfx = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdf
x = 1087n = 1430p =xn = 0.76standard error, SE = sqrt(p(1.pdf
 
Option B. ie More than one theseSolutionOption B. ie More than.pdf
Option B. ie More than one theseSolutionOption B. ie More than.pdfOption B. ie More than one theseSolutionOption B. ie More than.pdf
Option B. ie More than one theseSolutionOption B. ie More than.pdf
 
When two genes are located on the same chromosome they are called as.pdf
When two genes are located on the same chromosome they are called as.pdfWhen two genes are located on the same chromosome they are called as.pdf
When two genes are located on the same chromosome they are called as.pdf
 
We have layered model used in network design since these layers grou.pdf
We have layered model used in network design since these layers grou.pdfWe have layered model used in network design since these layers grou.pdf
We have layered model used in network design since these layers grou.pdf
 
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdf
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdfThe half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdf
The half-reactions areAnode Fe = [Fe]2+ + 2 e-Fe(s) release.pdf
 
The answer is CH2Since moles = massmolar massMoles of C H = .pdf
The answer is CH2Since moles = massmolar massMoles of C  H = .pdfThe answer is CH2Since moles = massmolar massMoles of C  H = .pdf
The answer is CH2Since moles = massmolar massMoles of C H = .pdf
 
SolutionFICASocial Security withheld taxMedicre tax withheldRates.pdf
SolutionFICASocial  Security withheld taxMedicre tax  withheldRates.pdfSolutionFICASocial  Security withheld taxMedicre tax  withheldRates.pdf
SolutionFICASocial Security withheld taxMedicre tax withheldRates.pdf
 
Since HCL is a strong acid we can assume that it will fulyy ionise.pdf
Since HCL is a strong acid we can assume that it will fulyy ionise.pdfSince HCL is a strong acid we can assume that it will fulyy ionise.pdf
Since HCL is a strong acid we can assume that it will fulyy ionise.pdf
 
d) Peptide Note that forming a peptide bond resu.pdf
                     d) Peptide  Note that forming a peptide bond resu.pdf                     d) Peptide  Note that forming a peptide bond resu.pdf
d) Peptide Note that forming a peptide bond resu.pdf
 
Security has been the number 1 issue for any IT industry and organiz.pdf
Security has been the number 1 issue for any IT industry and organiz.pdfSecurity has been the number 1 issue for any IT industry and organiz.pdf
Security has been the number 1 issue for any IT industry and organiz.pdf
 
P.E = - k e2 rnP.E in nth orbit is UnP.E is inversely propotio.pdf
P.E = - k e2  rnP.E in nth orbit is UnP.E is inversely propotio.pdfP.E = - k e2  rnP.E in nth orbit is UnP.E is inversely propotio.pdf
P.E = - k e2 rnP.E in nth orbit is UnP.E is inversely propotio.pdf
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

#ifndef COURSES_H #define COURSES_H class Courses { privat.pdf

  • 1. #ifndef COURSES_H #define COURSES_H class Courses { private: struct CourseList { char courseNum[10]; char courseName[25]; char courseSch[20]; CourseList *next; }; CourseList *head; void displayArrayChar(char [], int); public: Courses(void) {head=NULL;} ~Courses(void); void appendCourse(char [],char [], char []); void appendCourse(CourseList *); void deleteCourse(char []); bool searchforCourse(char []); void displayAllCourses(void); void editCourses(char [], char [], int ); void emptyCourses(void); //function called when a student is deleted CourseList* getHead(void){return head;} //friend void StudentInfo::insertStudent(char [], char [], int [], CourseList *); }; #endif ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //studentinfo.h
  • 2. #ifndef STUDENTINFO_H #define STUDENTINFO_H #include #include "Courses.h" using namespace std; class StudentInfo { private: struct StudentList { char firstName[12]; char lastName[12]; int ssn[9]; Courses studentCourses; struct StudentList *next; }; StudentList *ssnhead; int tempStoreSSN[9]; void displayArrayChar(char [], int); void displayArrayInt(int []); bool testIntArray(int [], int []); public: StudentInfo(void) {ssnhead=NULL;} ~StudentInfo(void); void insertStudent(char [], char [], int [], Courses &); void insertStudent(char fn[], char ln[], int s[]); void deleteStudent(int []);
  • 3. bool searchBylast(char []); bool searchByssn(int []); void displayAllStudents(void); void editStudentInfo(int []); void editStudentInfo(char [],int); int getTempssn(int); void storessnTemp(char [], int); }; #endif ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //courses.cpp #include #include #include #include "courses.h" #include "studentinfo.h" using namespace std; Courses::~Courses(void) { CourseList *nodePtr, *nextNode; nodePtr=head; while (nodePtr !=NULL) { nextNode=nodePtr->next; delete nodePtr; nodePtr=nextNode; } head=NULL; } void Courses::appendCourse(CourseList *tempHead) //should only pass the head pointer of the node
  • 4. { CourseList *nodePtr, *nodeTempPtr, *newNode; nodePtr=head; nodeTempPtr=nodePtr; while(nodeTempPtr->next !=NULL) {nodePtr=nodePtr->next; } nodeTempPtr = tempHead; while(nodeTempPtr->next !=NULL) { newNode=new CourseList; strcpy(newNode->courseNum, nodeTempPtr->courseNum); strcpy(newNode->courseName, nodeTempPtr->courseName); strcpy(newNode->courseSch, nodeTempPtr->courseSch); newNode->next=NULL; nodePtr->next=newNode; nodePtr=nodePtr->next; nodeTempPtr=nodeTempPtr->next; } } void Courses::appendCourse(char cNum[], char cName[], char cSch[]) { CourseList *newNode, *nodePtr; newNode=new CourseList; strcpy(newNode->courseNum, cNum); strcpy(newNode->courseName, cName); strcpy(newNode->courseSch, cSch); newNode->next=NULL;
  • 5. if(!head) head=newNode; else { nodePtr=head; while(nodePtr->next) { nodePtr=nodePtr->next; } nodePtr->next=newNode; } } void Courses::emptyCourses(void) { CourseList *nodePtr, *nextNode; nodePtr=head; while (nodePtr !=NULL) { nextNode=nodePtr->next; delete nodePtr; nodePtr=nextNode; } head=NULL; } void Courses::displayAllCourses(void) { CourseList *nodePtr; nodePtr=head; if(!head) cout<< " This Student isn't registered for any classes ";
  • 6. while(nodePtr) { displayArrayChar(nodePtr->courseNum, 10); cout<< " "; displayArrayChar(nodePtr->courseName, strlen(nodePtr->courseName)); cout<< " "; displayArrayChar(nodePtr->courseSch, strlen(nodePtr->courseSch)); cout<<" "; nodePtr=nodePtr->next; } } void Courses::displayArrayChar(char array[], int elms) { for(int counter=0; counter < elms; counter++) { cout<< array[counter]; } } void Courses::deleteCourse(char array[]) { CourseList *nodePtr, *previousNode; head->courseNum[10]=NULL; //THE FUNCTION WON'T WORK W/O THIS if(!head) return; if(strcmp(head->courseNum, array) == 0) { nodePtr=head->next; delete head; head=nodePtr; }
  • 7. else { nodePtr=head; while(nodePtr->next !=NULL && strcmp(array, nodePtr->courseNum) !=0) { previousNode=nodePtr; nodePtr=nodePtr->next; } previousNode->next=nodePtr->next; delete nodePtr; } } bool Courses::searchforCourse(char array[]) { CourseList *nodePtr; if(!head) return false; if(strcmp(head->courseNum, array) == 0) return true; else { nodePtr=head; while(nodePtr !=NULL && strcmp(nodePtr->courseNum, array) !=0) { if(strcmp(nodePtr->courseNum, array) ==0) return true; nodePtr=nodePtr->next; }
  • 8. return false; } } void Courses::editCourses(char course[], char change[], int choice) { CourseList *nodePtr; nodePtr=head; head->courseNum[1]=NULL; //THE FUNCTION WON'T WORK WITHOUT THIS if(strcmp(head->courseNum, course) == 0); else { while(nodePtr->next !=NULL && strcmp(course, nodePtr->courseNum) !=0) { nodePtr=nodePtr->next; } } switch(choice) { case 1://Changes the Course Number strcpy(nodePtr->courseNum, change); break; case 2://Changes the Course Name strcpy(nodePtr->courseName, change); break; case 3://Changes the Course Schedule strcpy(nodePtr->courseSch, change); break; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Studentinfo.cpp
  • 9. #include #include #include #include #include "studentinfo.h" #include "courses.h" using namespace std; StudentInfo::~StudentInfo(void) { StudentList *nodePtr, *nextNode; nodePtr=ssnhead; while(nodePtr !=NULL) { nextNode=nodePtr->next; ssnhead->next->studentCourses.emptyCourses(); delete nodePtr; nodePtr=nextNode; } ssnhead->next=NULL; } void StudentInfo::insertStudent(char fn[], char ln[], int s[], Courses &stdcourses) { StudentList *newNode, *nodePtr, *previousNode; newNode=new StudentList; strcpy(newNode->firstName, fn); strcpy(newNode->lastName, ln); for(int count=0; count<9; count++) newNode->ssn[count]=s[count]; newNode->studentCourses.appendCourse(stdcourses.getHead()); newNode->next=NULL; if(ssnhead==NULL) //There should be no information stored in the head {
  • 10. ssnhead=newNode; } else { nodePtr= ssnhead; while(nodePtr !=NULL) { previousNode=nodePtr; nodePtr=nodePtr->next; } if(previousNode==NULL) { ssnhead->next=newNode; //There should be no information stored in the head newNode->next=nodePtr; } else { previousNode->next=newNode; newNode->next=nodePtr; } } } void StudentInfo::insertStudent(char fn[], char ln[], int s[]) { StudentList *newNode, *nodePtr, *previousNode; newNode=new StudentList; strcpy(newNode->firstName, fn); strcpy(newNode->lastName, ln); for(int count=0; count<9; count++) newNode->ssn[count]=s[count]; if(ssnhead==NULL) { ssnhead->next=newNode;
  • 12. return; if(testIntArray(ssnhead->next->ssn, s) == true) { nodePtr = ssnhead->next->next; ssnhead->next->studentCourses.emptyCourses(); delete ssnhead->next; ssnhead->next=nodePtr; } else { nodePtr=ssnhead->next; while(nodePtr !=NULL && testIntArray(ssnhead->next->ssn, s) != true) { previousNode=nodePtr; nodePtr=nodePtr->next; } previousNode->next=nodePtr->next; ssnhead->next->studentCourses.emptyCourses(); delete nodePtr; } } void StudentInfo::displayArrayChar(char array[], int elms) { for(int counter=0; counter< elms; counter++) { cout<< array[counter]; } } void StudentInfo::displayArrayInt(int array[]) { for(int counter = 0; counter<9; counter++) { cout<< array[counter];
  • 13. } } void StudentInfo::displayAllStudents() { StudentList *nodePtr; nodePtr = ssnhead; if(ssnhead==NULL) { cout<< " There aren't any students in the database. "; return; } while(nodePtr) { cout << " made it in" << endl; cout<< " "; displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< " "; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< " "; displayArrayInt(nodePtr->ssn); cout<< " "; nodePtr->studentCourses.displayAllCourses(); cout<< endl; } } bool StudentInfo::searchBylast(char name[]) { StudentList *nodePtr; nodePtr=ssnhead->next; int temp=0;
  • 14. if(nodePtr==NULL) return false; while(nodePtr !=NULL) { if(strcmp(name, nodePtr->lastName) == 0) { cout<< endl<< (temp + 1)<< "-"; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< ", "; displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl; temp++; } if(nodePtr==NULL && temp !=0) { return true; } nodePtr=nodePtr->next; } return false; } bool StudentInfo::searchByssn(int social[]) { StudentList *nodePtr; nodePtr=ssnhead->next; if(nodePtr==NULL) return false; while(nodePtr !=NULL) { if(testIntArray(social, nodePtr->ssn) == true) { cout<< " "; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout << ", ";
  • 15. displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl; return true; } nodePtr=nodePtr->next; } return false; } void StudentInfo::storessnTemp(char name[], int count) { StudentList *nodePtr; nodePtr=ssnhead->next; int counter=1; while(nodePtr !=NULL) { if(strcmp(name, nodePtr->lastName) == 0) { if(counter == count) { for(int c=0; c<9; c++) tempStoreSSN[c] = nodePtr->ssn[c]; } else counter++; } nodePtr= nodePtr->next; } } int StudentInfo::getTempssn(int e) { return tempStoreSSN[e]; } void StudentInfo::editStudentInfo(char futurechange[], int choice)
  • 16. { StudentList *nodePtr; nodePtr=ssnhead->next; while(nodePtr !=NULL && testIntArray(tempStoreSSN, nodePtr->ssn) == true) { nodePtr=nodePtr->next; } switch(choice) { case 1://Changes first name strcpy(nodePtr->firstName, futurechange); break; case 2://Changes last name strcpy(nodePtr->lastName, futurechange); break; } } void StudentInfo::editStudentInfo(int futurechange[]) { StudentList *nodePtr; nodePtr=ssnhead->next; while(testIntArray(tempStoreSSN, nodePtr->ssn) ==true && nodePtr !=NULL) { nodePtr=nodePtr->next; } for(int count = 0; count<9; count++) nodePtr->ssn[count]=futurechange[count]; } bool StudentInfo::testIntArray(int a[], int b[]) {
  • 17. for(int count=0; count<9; count++) { if(a[count] != b[count]) return false; } return true; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //mainprogram.cpp #include #include #include #include #include "studentinfo.h" #include "courses.h" #define ERROR " You've Entered An Invalid Character! " void displayname(void); void getStudentInfo(StudentInfo &); bool changeCase(char [], int); void getCourseInfo(Courses &); bool yesorno(void); int mainMenu(void); void directions(void); Solution #ifndef COURSES_H #define COURSES_H class Courses { private: struct CourseList
  • 18. { char courseNum[10]; char courseName[25]; char courseSch[20]; CourseList *next; }; CourseList *head; void displayArrayChar(char [], int); public: Courses(void) {head=NULL;} ~Courses(void); void appendCourse(char [],char [], char []); void appendCourse(CourseList *); void deleteCourse(char []); bool searchforCourse(char []); void displayAllCourses(void); void editCourses(char [], char [], int ); void emptyCourses(void); //function called when a student is deleted CourseList* getHead(void){return head;} //friend void StudentInfo::insertStudent(char [], char [], int [], CourseList *); }; #endif ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //studentinfo.h #ifndef STUDENTINFO_H #define STUDENTINFO_H #include #include "Courses.h" using namespace std;
  • 19. class StudentInfo { private: struct StudentList { char firstName[12]; char lastName[12]; int ssn[9]; Courses studentCourses; struct StudentList *next; }; StudentList *ssnhead; int tempStoreSSN[9]; void displayArrayChar(char [], int); void displayArrayInt(int []); bool testIntArray(int [], int []); public: StudentInfo(void) {ssnhead=NULL;} ~StudentInfo(void); void insertStudent(char [], char [], int [], Courses &); void insertStudent(char fn[], char ln[], int s[]); void deleteStudent(int []); bool searchBylast(char []); bool searchByssn(int []); void displayAllStudents(void); void editStudentInfo(int []); void editStudentInfo(char [],int); int getTempssn(int); void storessnTemp(char [], int);
  • 20. }; #endif ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //courses.cpp #include #include #include #include "courses.h" #include "studentinfo.h" using namespace std; Courses::~Courses(void) { CourseList *nodePtr, *nextNode; nodePtr=head; while (nodePtr !=NULL) { nextNode=nodePtr->next; delete nodePtr; nodePtr=nextNode; } head=NULL; } void Courses::appendCourse(CourseList *tempHead) //should only pass the head pointer of the node { CourseList *nodePtr, *nodeTempPtr, *newNode; nodePtr=head; nodeTempPtr=nodePtr; while(nodeTempPtr->next !=NULL) {nodePtr=nodePtr->next; }
  • 21. nodeTempPtr = tempHead; while(nodeTempPtr->next !=NULL) { newNode=new CourseList; strcpy(newNode->courseNum, nodeTempPtr->courseNum); strcpy(newNode->courseName, nodeTempPtr->courseName); strcpy(newNode->courseSch, nodeTempPtr->courseSch); newNode->next=NULL; nodePtr->next=newNode; nodePtr=nodePtr->next; nodeTempPtr=nodeTempPtr->next; } } void Courses::appendCourse(char cNum[], char cName[], char cSch[]) { CourseList *newNode, *nodePtr; newNode=new CourseList; strcpy(newNode->courseNum, cNum); strcpy(newNode->courseName, cName); strcpy(newNode->courseSch, cSch); newNode->next=NULL; if(!head) head=newNode; else { nodePtr=head; while(nodePtr->next) {
  • 22. nodePtr=nodePtr->next; } nodePtr->next=newNode; } } void Courses::emptyCourses(void) { CourseList *nodePtr, *nextNode; nodePtr=head; while (nodePtr !=NULL) { nextNode=nodePtr->next; delete nodePtr; nodePtr=nextNode; } head=NULL; } void Courses::displayAllCourses(void) { CourseList *nodePtr; nodePtr=head; if(!head) cout<< " This Student isn't registered for any classes "; while(nodePtr) { displayArrayChar(nodePtr->courseNum, 10); cout<< " "; displayArrayChar(nodePtr->courseName, strlen(nodePtr->courseName)); cout<< " "; displayArrayChar(nodePtr->courseSch, strlen(nodePtr->courseSch)); cout<<" ";
  • 23. nodePtr=nodePtr->next; } } void Courses::displayArrayChar(char array[], int elms) { for(int counter=0; counter < elms; counter++) { cout<< array[counter]; } } void Courses::deleteCourse(char array[]) { CourseList *nodePtr, *previousNode; head->courseNum[10]=NULL; //THE FUNCTION WON'T WORK W/O THIS if(!head) return; if(strcmp(head->courseNum, array) == 0) { nodePtr=head->next; delete head; head=nodePtr; } else { nodePtr=head; while(nodePtr->next !=NULL && strcmp(array, nodePtr->courseNum) !=0) { previousNode=nodePtr;
  • 24. nodePtr=nodePtr->next; } previousNode->next=nodePtr->next; delete nodePtr; } } bool Courses::searchforCourse(char array[]) { CourseList *nodePtr; if(!head) return false; if(strcmp(head->courseNum, array) == 0) return true; else { nodePtr=head; while(nodePtr !=NULL && strcmp(nodePtr->courseNum, array) !=0) { if(strcmp(nodePtr->courseNum, array) ==0) return true; nodePtr=nodePtr->next; } return false; } } void Courses::editCourses(char course[], char change[], int choice) { CourseList *nodePtr;
  • 25. nodePtr=head; head->courseNum[1]=NULL; //THE FUNCTION WON'T WORK WITHOUT THIS if(strcmp(head->courseNum, course) == 0); else { while(nodePtr->next !=NULL && strcmp(course, nodePtr->courseNum) !=0) { nodePtr=nodePtr->next; } } switch(choice) { case 1://Changes the Course Number strcpy(nodePtr->courseNum, change); break; case 2://Changes the Course Name strcpy(nodePtr->courseName, change); break; case 3://Changes the Course Schedule strcpy(nodePtr->courseSch, change); break; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Studentinfo.cpp #include #include #include #include #include "studentinfo.h" #include "courses.h" using namespace std;
  • 26. StudentInfo::~StudentInfo(void) { StudentList *nodePtr, *nextNode; nodePtr=ssnhead; while(nodePtr !=NULL) { nextNode=nodePtr->next; ssnhead->next->studentCourses.emptyCourses(); delete nodePtr; nodePtr=nextNode; } ssnhead->next=NULL; } void StudentInfo::insertStudent(char fn[], char ln[], int s[], Courses &stdcourses) { StudentList *newNode, *nodePtr, *previousNode; newNode=new StudentList; strcpy(newNode->firstName, fn); strcpy(newNode->lastName, ln); for(int count=0; count<9; count++) newNode->ssn[count]=s[count]; newNode->studentCourses.appendCourse(stdcourses.getHead()); newNode->next=NULL; if(ssnhead==NULL) //There should be no information stored in the head { ssnhead=newNode; } else { nodePtr= ssnhead; while(nodePtr !=NULL) { previousNode=nodePtr;
  • 27. nodePtr=nodePtr->next; } if(previousNode==NULL) { ssnhead->next=newNode; //There should be no information stored in the head newNode->next=nodePtr; } else { previousNode->next=newNode; newNode->next=nodePtr; } } } void StudentInfo::insertStudent(char fn[], char ln[], int s[]) { StudentList *newNode, *nodePtr, *previousNode; newNode=new StudentList; strcpy(newNode->firstName, fn); strcpy(newNode->lastName, ln); for(int count=0; count<9; count++) newNode->ssn[count]=s[count]; if(ssnhead==NULL) { ssnhead->next=newNode; newNode->next=NULL; } else { nodePtr=ssnhead; while(nodePtr !=NULL) {
  • 28. previousNode=nodePtr; nodePtr=nodePtr->next; } if(previousNode==NULL) { ssnhead=newNode; newNode->next=nodePtr; } else { previousNode->next=newNode; newNode->next=nodePtr; } } } void StudentInfo::deleteStudent(int s[]) { StudentList *nodePtr, *previousNode; if(s[0] ==-1) { for(int c=0; c<10; c++) s[c]=tempStoreSSN[c]; tempStoreSSN[0]=NULL; } if(!ssnhead->next) return; if(testIntArray(ssnhead->next->ssn, s) == true) { nodePtr = ssnhead->next->next; ssnhead->next->studentCourses.emptyCourses(); delete ssnhead->next; ssnhead->next=nodePtr; }
  • 29. else { nodePtr=ssnhead->next; while(nodePtr !=NULL && testIntArray(ssnhead->next->ssn, s) != true) { previousNode=nodePtr; nodePtr=nodePtr->next; } previousNode->next=nodePtr->next; ssnhead->next->studentCourses.emptyCourses(); delete nodePtr; } } void StudentInfo::displayArrayChar(char array[], int elms) { for(int counter=0; counter< elms; counter++) { cout<< array[counter]; } } void StudentInfo::displayArrayInt(int array[]) { for(int counter = 0; counter<9; counter++) { cout<< array[counter]; } } void StudentInfo::displayAllStudents() { StudentList *nodePtr; nodePtr = ssnhead;
  • 30. if(ssnhead==NULL) { cout<< " There aren't any students in the database. "; return; } while(nodePtr) { cout << " made it in" << endl; cout<< " "; displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< " "; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< " "; displayArrayInt(nodePtr->ssn); cout<< " "; nodePtr->studentCourses.displayAllCourses(); cout<< endl; } } bool StudentInfo::searchBylast(char name[]) { StudentList *nodePtr; nodePtr=ssnhead->next; int temp=0; if(nodePtr==NULL) return false; while(nodePtr !=NULL) { if(strcmp(name, nodePtr->lastName) == 0) {
  • 31. cout<< endl<< (temp + 1)<< "-"; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout<< ", "; displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl; temp++; } if(nodePtr==NULL && temp !=0) { return true; } nodePtr=nodePtr->next; } return false; } bool StudentInfo::searchByssn(int social[]) { StudentList *nodePtr; nodePtr=ssnhead->next; if(nodePtr==NULL) return false; while(nodePtr !=NULL) { if(testIntArray(social, nodePtr->ssn) == true) { cout<< " "; displayArrayChar(nodePtr->lastName, strlen(nodePtr->lastName)); cout << ", "; displayArrayChar(nodePtr->firstName, strlen(nodePtr->firstName)); cout<< endl; return true; } nodePtr=nodePtr->next; } return false; }
  • 32. void StudentInfo::storessnTemp(char name[], int count) { StudentList *nodePtr; nodePtr=ssnhead->next; int counter=1; while(nodePtr !=NULL) { if(strcmp(name, nodePtr->lastName) == 0) { if(counter == count) { for(int c=0; c<9; c++) tempStoreSSN[c] = nodePtr->ssn[c]; } else counter++; } nodePtr= nodePtr->next; } } int StudentInfo::getTempssn(int e) { return tempStoreSSN[e]; } void StudentInfo::editStudentInfo(char futurechange[], int choice) { StudentList *nodePtr; nodePtr=ssnhead->next; while(nodePtr !=NULL && testIntArray(tempStoreSSN, nodePtr->ssn) == true) { nodePtr=nodePtr->next; }
  • 33. switch(choice) { case 1://Changes first name strcpy(nodePtr->firstName, futurechange); break; case 2://Changes last name strcpy(nodePtr->lastName, futurechange); break; } } void StudentInfo::editStudentInfo(int futurechange[]) { StudentList *nodePtr; nodePtr=ssnhead->next; while(testIntArray(tempStoreSSN, nodePtr->ssn) ==true && nodePtr !=NULL) { nodePtr=nodePtr->next; } for(int count = 0; count<9; count++) nodePtr->ssn[count]=futurechange[count]; } bool StudentInfo::testIntArray(int a[], int b[]) { for(int count=0; count<9; count++) { if(a[count] != b[count]) return false; } return true; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • 34. //mainprogram.cpp #include #include #include #include #include "studentinfo.h" #include "courses.h" #define ERROR " You've Entered An Invalid Character! " void displayname(void); void getStudentInfo(StudentInfo &); bool changeCase(char [], int); void getCourseInfo(Courses &); bool yesorno(void); int mainMenu(void); void directions(void);