Commit e7a9191f authored by Jared Sexton's avatar Jared Sexton

Stabilizing MAIN

parent 964f8819
......@@ -35,12 +35,14 @@ int main() {
}
else if (teacher.checkRoster(currentUser) >= 0) {
int currentUserIndex = teacher.checkRoster(currentUser);
// Current user (Student object) : teacher.roster.at(currentUserIndex)
Student currentStudent;
currentStudent = teacher.getStudent(currentUserIndex);
// Current user (Student object) : currentStudent
// Insert Student Menu Here...
cout << "Student Menu: \n";
teacher.setStudent(currentStudent);
}
else {
cin.clear();
......
......@@ -16,6 +16,10 @@ using namespace std;
class Student {
public:
// Default constructor
Student() {
userName = "NoName";
}
//Default constructor for only a username
Student(string userNameIn) {
userName = userNameIn;
......@@ -27,6 +31,12 @@ class Student {
level = levelIn;
}
// Copy constructor
Student(const Student& studentIn) {
userName = studentIn.userName;
level = studentIn.level;
}
// Accessors
int getLevel() {
return level;
......
......@@ -233,7 +233,7 @@ const bool Teacher::getMenuActive() {
return teacherMenuActive;
}
const student getStudent(int vectorPosition) {
const Student Teacher::getStudent(int vectorPosition) {
return roster.at(vectorPosition);
}
......@@ -246,6 +246,6 @@ void Teacher::setUserName(string userNameIn) {
userName = userNameIn;
}
void setStudent(Student studentIn) {
roster.at(studentIn.checkRoster()) = studentIn;
void Teacher::setStudent(Student studentIn) {
roster.at(checkRoster(studentIn.getUserName())) = studentIn;
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ class Teacher {
const string getUserName();
const string getExitCode();
const bool getMenuActive();
const student getStudent(int vectorPosition);
const Student getStudent(int vectorPosition);
// Mutators
void setExitCode(string exitCodeIn);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment