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
0a0355c7
Commit
0a0355c7
authored
Mar 14, 2018
by
Eddy Marinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this
parent
dc73ebb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
Student.cpp
Student.cpp
+24
-16
Student.h
Student.h
+1
-0
No files found.
Student.cpp
View file @
0a0355c7
...
...
@@ -72,18 +72,18 @@ void Student::practice(){
char
choice
;
bool
gotitGood
,
testing
;
do
{
gotitGood
=
questionAsk
.
mainQuestionAsk
(
getLevel
());
gotitGood
=
questionAsk
.
mainQuestionAsk
(
getLevel
());
//set equal to a bool expression to check if true, also helps keep track
if
(
gotitGood
==
true
){
count
++
;
}
if
(
count
>=
3
){
do
{
cout
<<
"Would you like to test out? (Y)es/(N)o "
;
cin
>>
choice
;
if
(
choice
==
'Y'
){
if
(
choice
==
'Y'
){
//testing stage
testingStage
();
testing
=
true
;
break
;
}
else
if
(
choice
==
'N'
){
}
else
if
(
choice
==
'N'
){
//reset values for count
count
=
0
;
break
;
}
else
{
...
...
@@ -99,21 +99,29 @@ void Student::practice(){
//Testing Stage: congratulate if they get enough right. increment dificulty level.
//Testing Stage: exit testing mode and go back to menu.
void
Student
::
testingStage
(){
int
count
=
0
;
int
count
=
0
;
int
questions
=
10
;
int
levelIn
=
getLevel
();
char
choice
;
bool
testOut
,
finish
;
while
(
true
){
testOut
=
questionAsk
.
mainQuestionAsk
(
getLevel
());
if
(
testOut
==
true
){
count
++
;
}
if
(
count
>=
5
){
cout
<<
"Congratulations! you have passed."
<<
endl
;
setLevel
(
++
levelIn
);
break
;
}
/* Note (from Jared): Can we add something so that this will only ask a certain number of questions (say, 10?)
and if they don't get enough f them right by then, it will tell them they need to practice more? */
}
while
(
question
>
1
){
testOut
=
questionAsk
.
mainQuestionAsk
(
getLevel
());
//set equal to a bool expression to check if true, also helps keep track
if
(
testOut
==
false
){
//decrements question var if wrong
question
--
;
}
if
(
testOut
==
true
){
//if right it increments the count and decrements the question var
count
++
;
question
--
;
}
if
(
count
>=
(
question
/
2
)){
cout
<<
"Congratulations! you have passed."
<<
endl
;
setLevel
(
++
levelIn
);
break
;
}
else
{
cout
<<
"Tough luck. try harder next time."
;
/* some code to loop it back to the practice section? */
}
/* Note (from Jared): Can we add something so that this will only ask a certain number of questions (say, 10?)
and if they don't get enough f them right by then, it will tell them they need to practice more? */
}
}
...
...
@@ -131,4 +139,4 @@ void Student::setLevel(int levelIn) {
void
Student
::
setUserName
(
string
userNameIn
)
{
userName
=
userNameIn
;
}
\ No newline at end of file
}
Student.h
View file @
0a0355c7
...
...
@@ -27,6 +27,7 @@ class Student {
// Accessors
int
getLevel
();
string
getUserName
();
const
bool
getMenuActive
();
//Student functions.
void
displayMenu
();
//Display menu; show the current level, option to practice or log out.
...
...
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