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
d6d145f2
Commit
d6d145f2
authored
Mar 01, 2018
by
Jared Sexton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating question class
parent
c2967515
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
1 deletion
+78
-1
Questions.cpp
Questions.cpp
+53
-0
Questions.h
Questions.h
+24
-0
SPECIFICATIONS.md
SPECIFICATIONS.md
+1
-1
No files found.
Questions.cpp
0 → 100644
View file @
d6d145f2
/* ============================================================================
Question class function file
Jared Sexton
============================================================================
*/
void
mainQuestionAsk
(
int
level
);
int
determineQuestion
(
int
level
);
bool
countingQuestion
(
int
level
)
{
switch
(
level
)
{
case
1
:
int
countTo
=
rand
%
5
;
break
;
case
2
:
int
countTo
=
rand
%
10
;
break
;
case
3
:
int
countTo
=
rand
%
20
;
break
;
default
cerr
<<
"Please see your teacher about your current level."
;
break
;
}
int
answer
;
for
(
int
i
=
0
;
i
<
countTo
;
i
++
)
{
if
(
countTo
%
2
==
0
)
cout
<<
"X "
;
else
cout
<<
"# "
;
}
cout
<<
"How many symbols are there?"
;
cin
>>
answer
;
if
(
countTo
==
answer
)
{
cout
<<
"Good job!"
;
return
true
;
}
else
cout
<<
"Better luck next time."
;
return
false
;
}
void
addSubQuestion
(
int
level
);
void
wordQuestion
(
int
level
);
\ No newline at end of file
Questions.h
0 → 100644
View file @
d6d145f2
/* ============================================================================
Question class header file
Jared Sexton
============================================================================
*/
#include <iostream>
class
Questions
{
void
mainQuestionAsk
(
int
level
);
int
determineQuestion
(
int
level
);
// Asks a question, returns true if the kid was right, false if they were wrong.
bool
countingQuestion
(
int
level
);
void
addSubQuestion
(
int
level
);
void
wordQuestion
(
int
level
);
};
SPECIFICATIONS.md
View file @
d6d145f2
...
...
@@ -41,7 +41,7 @@
| --------------------------------- | ------------- | --------- |
| Create class "Teacher" | Person | March 9 |
| Create class "Student" | Person | March 9 |
| Create class "Questions" | Jared | March 9 |
| Create class "Questions" | Jared
| March 9 |
| Structure the File I/O | Person | March 4 |
| Compile main code | Person | March 11 |
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