Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
cptr142_group_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jared Sexton
cptr142_group_project
Commits
9d76f3c2
Commit
9d76f3c2
authored
Mar 08, 2018
by
Andrew Binder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added accessor/mutator for a student in the roster vector
parent
eda9d7ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
Teacher.cpp
Teacher.cpp
+8
-0
Teacher.h
Teacher.h
+5
-2
No files found.
Teacher.cpp
View file @
9d76f3c2
...
...
@@ -233,6 +233,10 @@ const bool Teacher::getMenuActive() {
return
teacherMenuActive
;
}
const
student
getStudent
(
int
vectorPosition
)
{
return
roster
.
at
(
vectorPosition
);
}
// Mutators
void
Teacher
::
setExitCode
(
string
exitCodeIn
)
{
exitCode
=
exitCodeIn
;
...
...
@@ -240,4 +244,8 @@ void Teacher::setExitCode(string exitCodeIn) {
void
Teacher
::
setUserName
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
void
setStudent
(
Student
studentIn
)
{
roster
.
at
(
studentIn
.
checkRoster
())
=
studentIn
;
}
\ No newline at end of file
Teacher.h
View file @
9d76f3c2
...
...
@@ -28,22 +28,25 @@ class Teacher {
void
adjustProgress
(
string
studentUserNameIn
,
int
level
);
// Changes a students level; includes error checking for student username
int
checkRoster
(
string
student
);
// Returns a student's position on vector if username student exists in vector; Returns -1 if student does not exist
void
endProgram
();
// saves and ends program gracefully
// Accessors
const
string
getUserName
();
const
string
getExitCode
();
const
bool
getMenuActive
();
const
student
getStudent
(
int
vectorPosition
);
// Mutators
void
setExitCode
(
string
exitCodeIn
);
void
setUserName
(
string
userNameIn
);
void
setStudent
(
Student
studentIn
);
// I think it's safe to say that studentIn will be a student in the vector
vector
<
Student
>
roster
;
//
vector<Student> roster;
private:
bool
teacherMenuActive
=
1
;
string
userName
;
string
exitCode
=
"Quit"
;
//
vector<Student> roster;
vector
<
Student
>
roster
;
// Strings for file I/O
// If a file location needs to be changed, this is the place to do it!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment