-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchoolDatabase.h
More file actions
executable file
·55 lines (48 loc) · 2.1 KB
/
SchoolDatabase.h
File metadata and controls
executable file
·55 lines (48 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Jaden Heller
// 2328279
// jaheller@chapman.edu
// CPSC-350-01
// Assignment 6
#ifndef SCHOOLDATABASE_H
#define SCHOOLDATABASE_H
#include "GenDatabase.h"
#include "Student.h"
#include "Faculty.h"
#include <cstdlib> //This and ctime for Rand() function
#include <ctime>
//Implements GenDatabase to create a Student-Table and Faculty-Table,
//handles the functions that require an interaction between the two
//(changing and removing advisors/advisees), and defines the functions
//that will be present to the user.
class SchoolDatabase{
public:
SchoolDatabase();
~SchoolDatabase();
void PrintStudentTable();//Print every student and their info
void PrintFacultyTable();//Print every faculty and their info
void PrintStudentInfo(int studentID);//Print a student's info given their ID
void PrintFacultyInfo(int facultyID);//Print a faculty member's info given their ID
int GetAdvisorOfStud(int studentID);
void PrintAdviseesOfFac(int facultyID);
void AddNewStudent(Student* student);
void AddNewFaculty(Faculty* facMember);
void RemoveStudent(int studentID);
void RemoveFaculty(int facultyID);
void ChangeAdvisorOfStudent(int studentID, int newfacultyID);
void RemoveAdviseeOfFac(int facultyID, int removeStudID);//Deletes a student from a fac's advisee List
void RollBack(); //Undo function
void AddAdviseeOfFac(int facultyID, int addStudentID);//Add advisee to Fac's list
int GenRandomID(bool isStudent);
int IDfromString(string idString); //Safely convert IDs entered as strings to ints
void ExportDatabase(string tableType); //Saves the info into a txt file
void ImportDatabase(string inputArray[], int arraySize); //Imports data from file when opening
private:
GenDatabase<Faculty*> *facultyTable;
GenDatabase<Student*> *studentTable;
myList<int> *unAdvisedStudents; //Students who dont have an advisor at the moment
void PrintidNotFoundErr(int missingID, string idType);
int nullID; //Garbage ID number
int getDefaultAdvisor();
bool DatabaseIsEmpty();
};
#endif