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
41a2240d
Commit
41a2240d
authored
Mar 06, 2018
by
Andrew Binder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teacher file updates
parent
bce03cab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
12 deletions
+53
-12
Teacher.cpp
Teacher.cpp
+42
-7
Teacher.h
Teacher.h
+5
-5
Teacher_Driver.cpp
Teacher_Driver.cpp
+6
-0
No files found.
Teacher.cpp
View file @
41a2240d
...
...
@@ -6,7 +6,8 @@ Teacher::Teacher(string userNameIn) {
}
void
Teacher
::
displayMenu
()
{
cout
<<
"Teacher Menu"
<<
endl
;
cout
<<
"____________"
<<
endl
;
}
void
Teacher
::
displayProgress
()
{
...
...
@@ -17,15 +18,49 @@ void Teacher::displayProgress() {
}
}
bool
Teacher
::
exportProgress
()
{
void
Teacher
::
exportProgress
()
{
}
bool
Teacher
::
enrollStudent
(
Student
studentIn
)
{
void
Teacher
::
enrollStudent
(
Student
studentIn
)
{
bool
validName
=
1
;
for
(
int
i
=
0
;
i
<
roster
.
size
();
i
++
)
{
if
(
roster
.
at
(
i
).
getUserName
()
==
studentIn
.
getUserName
())
{
validName
=
0
;
}
}
if
(
validName
)
{
roster
.
push_back
(
studentIn
);
cout
<<
"Student succesfully enrolled."
<<
endl
;
}
else
{
cout
<<
"Error: Student already exists!"
<<
endl
;
}
}
bool
Teacher
::
adjustProgress
(
Student
studentIn
,
int
level
)
{
void
Teacher
::
adjustProgress
(
string
studentUserNameIn
,
int
level
)
{
int
lastLevel
=
-
1
,
studentNumber
=
-
1
;
bool
validName
=
0
;
for
(
int
i
=
0
;
i
<
roster
.
size
();
i
++
)
{
if
(
roster
.
at
(
i
).
getUserName
()
==
studentUserNameIn
)
{
validName
=
1
;
studentNumber
=
i
;
}
}
if
(
validName
)
{
lastLevel
=
roster
.
at
(
studentNumber
).
getLevel
();
roster
.
at
(
studentNumber
).
setLevel
(
level
);
cout
<<
roster
.
at
(
studentNumber
).
getUserName
()
<<
"'s level was changed from level "
<<
lastLevel
<<
" to "
<<
roster
.
at
(
studentNumber
).
getLevel
()
<<
"."
<<
endl
;
}
else
{
cout
<<
"Error: Student not found!"
<<
endl
;
}
}
...
...
@@ -43,10 +78,10 @@ const string Teacher::getExitCode() {
}
// Mutators
bool
Teacher
::
setExitCode
(
string
exitCodeIn
)
{
void
Teacher
::
setExitCode
(
string
exitCodeIn
)
{
exitCode
=
exitCodeIn
;
}
bool
Teacher
::
setUserName
(
string
userNameIn
)
{
void
Teacher
::
setUserName
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
\ No newline at end of file
Teacher.h
View file @
41a2240d
...
...
@@ -36,9 +36,9 @@ class Teacher {
// Teacher Functions
void
displayMenu
();
void
displayProgress
();
// Opens menu, teacher get get all (gradebook style) or a student
bool
exportProgress
();
// outputProgress() in UML
bool
enrollStudent
(
Student
studentIn
);
bool
adjustProgress
(
Student
student
In
,
int
level
);
void
exportProgress
();
// outputProgress() in UML
void
enrollStudent
(
Student
studentIn
);
void
adjustProgress
(
string
studentUserName
In
,
int
level
);
void
endProgram
();
// Accessors
...
...
@@ -46,8 +46,8 @@ class Teacher {
const
string
getExitCode
();
// Mutators
bool
setExitCode
(
string
exitCodeIn
);
bool
setUserName
(
string
userNameIn
);
void
setExitCode
(
string
exitCodeIn
);
void
setUserName
(
string
userNameIn
);
private:
string
userName
;
...
...
Teacher_Driver.cpp
View file @
41a2240d
...
...
@@ -28,10 +28,16 @@ int main() {
testTeacher
.
enrollStudent
(
studentIn
);
}
//Student studentIn("Andrew");
//testTeacher.enrollStudent(studentIn);
cout
<<
"
\n
Now we will test the displayProgress() function.
\n
"
;
testTeacher
.
displayProgress
();
testTeacher
.
adjustProgress
(
"Andrew"
,
5
);
testTeacher
.
displayProgress
();
return
0
;
}
\ No newline at end of file
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