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
f57ad718
Commit
f57ad718
authored
Mar 01, 2018
by
Jared Sexton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating Question Class
parent
10e321d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
10 deletions
+47
-10
Question_driver.cpp
Question_driver.cpp
+4
-1
Questions.cpp
Questions.cpp
+40
-8
Questions.h
Questions.h
+3
-1
No files found.
Question_driver.cpp
View file @
f57ad718
...
...
@@ -11,7 +11,10 @@ using namespace std;
int
main
()
{
Questions
questionList
;
cout
<<
questionList
.
countingQuestion
(
2
);
questionList
.
countingQuestion
(
2
);
questionList
.
countingQuestion
(
2
);
questionList
.
countingQuestion
(
2
);
questionList
.
countingQuestion
(
2
);
return
0
;
}
\ No newline at end of file
Questions.cpp
View file @
f57ad718
...
...
@@ -9,11 +9,15 @@
#include <cstdlib>
using
namespace
std
;
void
mainQuestionAsk
(
int
level
);
void
Questions
::
mainQuestionAsk
(
int
level
)
{
int
determineQuestion
(
int
level
);
}
int
Questions
::
determineQuestion
(
int
level
)
{
return
0
;
}
bool
countingQuestion
(
int
level
)
{
bool
Questions
::
countingQuestion
(
int
level
)
{
int
countTo
;
switch
(
level
)
{
case
1
:
...
...
@@ -36,17 +40,45 @@ bool countingQuestion(int level) {
else
cout
<<
"# "
;
}
cout
<<
"
How many symbols are there?
"
;
cout
<<
"
\n
How many symbols are there?
"
;
cin
>>
answer
;
if
(
countTo
==
answer
)
{
cout
<<
"Good job!"
;
cout
<<
"Good job!
\n
"
;
return
true
;
}
else
cout
<<
"Better luck next time."
;
cout
<<
"Better luck next time.
\n
"
;
return
false
;
}
void
addSubQuestion
(
int
level
);
void
Questions
::
addSubQuestion
(
int
level
)
{
int
maxNumber
;
switch
(
level
)
{
case
4
:
maxNumber
=
rand
()
%
5
;
break
;
case
5
:
maxNumber
=
rand
()
%
10
;
break
;
case
6
:
maxNumber
=
rand
()
%
20
;
break
;
default:
cerr
<<
"Please see your teacher about your current level."
;
break
;
}
int
userAnswer
,
correctAnswer
;
if
(
userAnswer
==
correctAnswer
)
{
cout
<<
"Good job!
\n
"
;
return
true
;
}
else
cout
<<
"Better luck next time.
\n
"
;
return
false
;
}
void
wordQuestion
(
int
level
);
\ No newline at end of file
void
Questions
::
wordQuestion
(
int
level
)
{
}
\ No newline at end of file
Questions.h
View file @
f57ad718
...
...
@@ -5,7 +5,8 @@
*/
#ifndef QUESTIONS_H
#define QUESTIONS_H
class
Questions
{
public:
...
...
@@ -21,3 +22,4 @@ class Questions {
void
wordQuestion
(
int
level
);
};
#endif //QUESTIONS_H
\ 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