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
d9c7ddc4
Commit
d9c7ddc4
authored
Mar 14, 2018
by
Jared Sexton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maxLevel
parent
fb14e9c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
Questions.cpp
Questions.cpp
+1
-0
Questions.h
Questions.h
+6
-0
Student.cpp
Student.cpp
+19
-14
No files found.
Questions.cpp
View file @
d9c7ddc4
...
...
@@ -145,6 +145,7 @@ bool Questions::addSubQuestion(int level) {
return
false
;
}
bool
Questions
::
wordQuestion
(
int
level
)
{
cout
<<
"Question type not configured."
;
return
false
;
...
...
Questions.h
View file @
d9c7ddc4
...
...
@@ -23,6 +23,12 @@ class Questions {
// Asks a question, returns true if the kid was right, false if they were wrong.
bool
wordQuestion
(
int
level
);
// Accessor
int
getMaxLevel
()
{
return
maxLevel
;
}
private:
int
maxLevel
=
10
;
};
#endif //QUESTIONS_H
\ No newline at end of file
Student.cpp
View file @
d9c7ddc4
...
...
@@ -49,10 +49,7 @@ void Student::displayMenu(){
case
2
:
// Log Out
cout
<<
"Goodbye."
<<
endl
;
studentMenuActive
=
0
;
break
;
/* Can you have something here that will cause the program to exit the menu when they choose logout?
This can be done with a boolean return type for this function (returns true until they choose to logout, then it returns false)
Or with a separate function like Andrew did in Teacher (you can check his code for a template).
The idea is that as much of the process of each menu is contained within the menu function, (ecapsulation). */
break
;
default:
cout
<<
"Invalid choice.
\n
"
;
break
;
...
...
@@ -80,16 +77,24 @@ void Student::practice(){
do
{
cout
<<
"Would you like to test out? (Y)es/(N)o "
;
cin
>>
choice
;
if
(
choice
==
'Y'
){
//testing stage
testingStage
();
testing
=
true
;
break
;
}
else
if
(
choice
==
'N'
){
//reset values for count
count
=
0
;
break
;
}
else
{
cout
<<
"Invalid input."
<<
endl
;
continue
;
if
(
cin
)
{
if
(
choice
==
'Y'
){
//testing stage
testingStage
();
testing
=
true
;
break
;
}
else
if
(
choice
==
'N'
){
//reset values for count
count
=
0
;
break
;
}
else
{
cin
.
clear
();
cin
.
ignore
(
100
,
'\n'
);
cerr
<<
"Invalid choice."
<<
endl
;
continue
;
}
}
else
{
cin
.
clear
();
cin
.
ignore
(
100
,
'\n'
);
cerr
<<
"Invalid choice.
\n
"
;
}
}
while
(
true
);
}
...
...
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