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
bce03cab
Commit
bce03cab
authored
Mar 05, 2018
by
Andrew Binder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating Teacher Class
parent
96e1a154
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
7 deletions
+104
-7
Teacher.cpp
Teacher.cpp
+47
-0
Teacher.h
Teacher.h
+20
-7
Teacher_Driver.cpp
Teacher_Driver.cpp
+37
-0
No files found.
Teacher.cpp
View file @
bce03cab
#include "Teacher.h"
#include <iostream>
Teacher
::
Teacher
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
void
Teacher
::
displayMenu
()
{
}
void
Teacher
::
displayProgress
()
{
cout
<<
"------STUDENT GRADEBOOK------
\n
"
;
cout
<<
"Student
\t\t
Current Level
\n
"
;
for
(
int
i
=
0
;
i
<
roster
.
size
();
i
++
)
{
cout
<<
roster
.
at
(
i
).
getUserName
()
<<
"
\t\t
"
<<
roster
.
at
(
i
).
getLevel
()
<<
endl
;
}
}
bool
Teacher
::
exportProgress
()
{
}
bool
Teacher
::
enrollStudent
(
Student
studentIn
)
{
roster
.
push_back
(
studentIn
);
}
bool
Teacher
::
adjustProgress
(
Student
studentIn
,
int
level
)
{
}
void
Teacher
::
endProgram
()
{
}
// Accessors
const
string
Teacher
::
getUserName
()
{
return
userName
;
}
const
string
Teacher
::
getExitCode
()
{
return
exitCode
;
}
// Mutators
bool
Teacher
::
setExitCode
(
string
exitCodeIn
)
{
exitCode
=
exitCodeIn
;
}
bool
Teacher
::
setUserName
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
\ No newline at end of file
Teacher.h
View file @
bce03cab
...
...
@@ -5,6 +5,10 @@ using namespace std;
class
Student
{
public:
Student
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
int
getLevel
()
{
return
level
;
}
...
...
@@ -12,17 +16,20 @@ class Student {
return
userName
;
}
void
setLevel
(
int
levelIn
)
{
level
=
levelIn
;
}
void
setUserName
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
private:
string
userName
;
int
level
=
1
;
};
class
Teacher
{
private:
string
userName
;
string
exitCode
;
//vector<Student> roster;
public:
Teacher
(
string
userNameIn
);
// Default constructor
...
...
@@ -30,8 +37,8 @@ class Teacher {
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 studentIn, int level);
bool
enrollStudent
(
Student
studentIn
);
bool
adjustProgress
(
Student
studentIn
,
int
level
);
void
endProgram
();
// Accessors
...
...
@@ -41,4 +48,10 @@ class Teacher {
// Mutators
bool
setExitCode
(
string
exitCodeIn
);
bool
setUserName
(
string
userNameIn
);
private:
string
userName
;
string
exitCode
;
vector
<
Student
>
roster
;
};
\ No newline at end of file
Teacher_Driver.cpp
0 → 100644
View file @
bce03cab
// ***************************************
// Test Drive compilation instructions:
// g++ -std=c++11 Teacher_Driver.cpp Teacher.cpp -o Teacher_Driver.cpp.o
#include <string>
#include <iostream>
#include "Teacher.h"
using
namespace
std
;
int
main
()
{
string
teacherUserName
;
cout
<<
"First we will test the constructor:
\n
Input a username: "
;
cin
>>
teacherUserName
;
Teacher
testTeacher
(
teacherUserName
);
cout
<<
"The test teachers name is "
<<
testTeacher
.
getUserName
()
<<
".
\n\n
"
;
cout
<<
"Now, we will enroll some students.
\n
Enter three students names: "
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
string
studentNameIn
;
cin
>>
studentNameIn
;
Student
studentIn
(
studentNameIn
);
testTeacher
.
enrollStudent
(
studentIn
);
}
cout
<<
"
\n
Now we will test the displayProgress() function.
\n
"
;
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