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
06b24473
Commit
06b24473
authored
Mar 07, 2018
by
Jared Sexton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a MAIN program
parent
9a99c93c
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
73 additions
and
0 deletions
+73
-0
MAIN.cpp
MAIN.cpp
+57
-0
REFERENCES/GroupProjectUML.png
REFERENCES/GroupProjectUML.png
+0
-0
REFERENCES/PROPOSAL.md
REFERENCES/PROPOSAL.md
+0
-0
REFERENCES/Procedural Flow Diagram.png
REFERENCES/Procedural Flow Diagram.png
+0
-0
REFERENCES/README.md
REFERENCES/README.md
+0
-0
REFERENCES/SPECIFICATIONS.md
REFERENCES/SPECIFICATIONS.md
+0
-0
REFERENCES/_GRADE.md
REFERENCES/_GRADE.md
+0
-0
REFERENCES/code_review.md
REFERENCES/code_review.md
+0
-0
REFERENCES/groups_for_section_b.md
REFERENCES/groups_for_section_b.md
+0
-0
Teacher.cpp
Teacher.cpp
+10
-0
Teacher.h
Teacher.h
+3
-0
classProgress.txt
classProgress.txt
+1
-0
classRoster.txt
classRoster.txt
+2
-0
No files found.
MAIN.cpp
0 → 100644
View file @
06b24473
/* ============================================================================
Main Function
g++ -std=c++11 MAIN.cpp Questions.cpp Teacher.cpp -o MAIN.cpp.o && ./MAIN.cpp.o
Student.cpp
============================================================================
*/
#include "Questions.h"
#include "Student.h"
#include "Teacher.h"
#include <iostream> // For cout and cin
using
namespace
std
;
int
main
()
{
Teacher
teacher
;
teacher
.
importProgress
();
string
currentUser
;
bool
keepRunning
=
true
;
do
{
cout
<<
"Please enter your user name: "
;
cin
>>
currentUser
;
if
(
cin
)
{
if
(
currentUser
==
teacher
.
getExitCode
())
{
keepRunning
=
false
;
}
else
if
(
currentUser
==
teacher
.
getUserName
())
{
do
{
teacher
.
displayMenu
();
if
(
!
teacher
.
getMenuActive
())
{
break
;
}
}
while
(
true
);
}
else
if
(
teacher
.
checkRoster
(
currentUser
))
{
// Insert Student Menu Here...
cout
<<
"Student Menu:
\n
"
;
}
else
{
cin
.
clear
();
cin
.
ignore
(
100
,
'\n'
);
cerr
<<
"Invalid user name.
\n
"
;
}
}
else
{
cin
.
clear
();
cin
.
ignore
(
100
,
'\n'
);
cerr
<<
"Invalid user name.
\n
"
;
}
}
while
(
keepRunning
);
return
0
;
}
\ No newline at end of file
GroupProjectUML.png
→
REFERENCES/
GroupProjectUML.png
View file @
06b24473
File moved
PROPOSAL.md
→
REFERENCES/
PROPOSAL.md
View file @
06b24473
File moved
Procedural Flow Diagram.png
→
REFERENCES/
Procedural Flow Diagram.png
View file @
06b24473
File moved
README.md
→
RE
FERENCES/RE
ADME.md
View file @
06b24473
File moved
SPECIFICATIONS.md
→
REFERENCES/
SPECIFICATIONS.md
View file @
06b24473
File moved
_GRADE.md
→
REFERENCES/
_GRADE.md
View file @
06b24473
File moved
code_review.md
→
REFERENCES/
code_review.md
View file @
06b24473
File moved
groups_for_section_b.md
→
REFERENCES/
groups_for_section_b.md
View file @
06b24473
File moved
Teacher.cpp
View file @
06b24473
...
...
@@ -230,6 +230,16 @@ void Teacher::endProgram() {
exit
(
0
);
}
// Checks the roster for a given student, and returns true if found.
bool
Teacher
::
checkRoster
(
string
student
)
{
for
(
int
i
=
0
;
i
<
roster
.
size
();
i
++
)
{
if
(
roster
.
at
(
i
).
getUserName
()
==
student
)
{
return
true
;
}
}
return
false
;
}
// Accessors
const
string
Teacher
::
getUserName
()
{
return
userName
;
...
...
Teacher.h
View file @
06b24473
...
...
@@ -28,6 +28,9 @@ class Teacher {
void
adjustProgress
(
string
studentUserNameIn
,
int
level
);
// Changes a students level; includes error checking for student username
void
endProgram
();
// saves and ends program gracefully
/* Andrew - I added this function to search for a given student in the roster (for use in login stage) */
bool
checkRoster
(
string
student
);
// Accessors
const
string
getUserName
();
const
string
getExitCode
();
...
...
classProgress.txt
View file @
06b24473
...
...
@@ -14,3 +14,4 @@ inghro | 2
umalno | 1
grifno | 1
levina | 4
Andrew | 500
classRoster.txt
View file @
06b24473
...
...
@@ -12,4 +12,6 @@ umalno 1
grifno 1
levina 4
Andrew 500
Sam 2
Jared 1
END_OF_FILE
\ 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