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
cba7cbc5
Commit
cba7cbc5
authored
Mar 05, 2018
by
Jared Sexton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating Question Class
parent
77a9a9cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
Question_driver.cpp
Question_driver.cpp
+1
-1
Questions.cpp
Questions.cpp
+2
-6
Questions.h
Questions.h
+4
-3
No files found.
Question_driver.cpp
View file @
cba7cbc5
...
...
@@ -12,7 +12,7 @@ int main() {
Questions
questionList
;
for
(
int
i
=
1
;
i
<=
10
;
i
++
)
{
questionList
.
determineQuestion
(
i
);
questionList
.
mainQuestionAsk
(
i
);
cout
<<
"Level Up!
\n
"
;
}
...
...
Questions.cpp
View file @
cba7cbc5
...
...
@@ -10,11 +10,7 @@
#include <ctime> // For time(0)
using
namespace
std
;
void
Questions
::
mainQuestionAsk
(
int
level
)
{
}
bool
Questions
::
determineQuestion
(
int
level
)
{
bool
Questions
::
mainQuestionAsk
(
int
level
)
{
if
((
level
>=
1
)
&&
(
level
<=
3
))
{
return
countingQuestion
(
level
);
}
...
...
@@ -45,7 +41,7 @@ bool Questions::countingQuestion(int level) {
break
;
}
int
answer
;
countTo
++
;
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 "
;
...
...
Questions.h
View file @
cba7cbc5
...
...
@@ -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
);
bool
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