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
ec4c6a1f
Commit
ec4c6a1f
authored
Mar 05, 2018
by
Eddy Marinez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.cs.wallawalla.edu:sextja/cptr142_group_project
parents
7dfffad1
cba7cbc5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
Question_driver.cpp
Question_driver.cpp
+4
-4
Questions.cpp
Questions.cpp
+16
-7
Questions.h
Questions.h
+4
-3
No files found.
Question_driver.cpp
View file @
ec4c6a1f
...
...
@@ -11,10 +11,10 @@ using namespace std;
int
main
()
{
Questions
questionList
;
questionList
.
addSubQuestion
(
7
);
questionList
.
addSubQuestion
(
7
);
questionList
.
addSubQuestion
(
7
)
;
questionList
.
addSubQuestion
(
7
);
for
(
int
i
=
1
;
i
<=
10
;
i
++
)
{
questionList
.
mainQuestionAsk
(
i
);
cout
<<
"Level Up!
\n
"
;
}
return
0
;
}
\ No newline at end of file
Questions.cpp
View file @
ec4c6a1f
...
...
@@ -10,15 +10,20 @@
#include <ctime> // For time(0)
using
namespace
std
;
void
Questions
::
mainQuestionAsk
(
int
level
)
{
}
int
Questions
::
determineQuestion
(
int
level
)
{
return
0
;
bool
Questions
::
mainQuestionAsk
(
int
level
)
{
if
((
level
>=
1
)
&&
(
level
<=
3
))
{
return
countingQuestion
(
level
);
}
else
if
((
level
>=
4
)
&&
(
level
<=
10
))
{
return
addSubQuestion
(
level
);
}
else
{
return
wordQuestion
(
level
);
}
}
bool
Questions
::
countingQuestion
(
int
level
)
{
srand
(
time
(
0
));
int
countTo
;
switch
(
level
)
{
case
1
:
...
...
@@ -32,9 +37,11 @@ bool Questions::countingQuestion(int level) {
break
;
default:
cerr
<<
"Please see your teacher about your current level."
;
return
false
;
break
;
}
int
answer
;
countTo
++
;
//To set the possible range to 1 -> maximum, instead of 0 -> (maximum -1)
for
(
int
i
=
0
;
i
<
countTo
;
i
++
)
{
if
(
countTo
%
2
==
0
)
cout
<<
"X "
;
...
...
@@ -83,6 +90,7 @@ bool Questions::addSubQuestion(int level) {
break
;
default:
cerr
<<
"Please see your teacher about your current level.
\n
"
;
return
false
;
break
;
}
...
...
@@ -138,5 +146,6 @@ bool Questions::addSubQuestion(int level) {
}
bool
Questions
::
wordQuestion
(
int
level
)
{
cout
<<
"Question type not configured."
;
return
false
;
}
\ No newline at end of file
Questions.h
View file @
ec4c6a1f
...
...
@@ -2,6 +2,7 @@
Question class header file
Jared Sexton
============================================================================
Currently, questions are configured for levels 1 through 10.
*/
...
...
@@ -10,9 +11,9 @@
class
Questions
{
public:
void
mainQuestionAsk
(
int
level
);
int
determineQuestion
(
int
level
);
// Asks the proper question based on the player's level.
// It returns true if they answered correctly, and false if not.
bool
mainQuestionAsk
(
int
level
);
// Asks a question, returns true if the kid was right, false if they were wrong.
bool
countingQuestion
(
int
level
);
...
...
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