There are two parts to the final exam, a C++ programming project that is due on the day of the exam and a Matlab activitypart that you will do in class.
C++
The programming assignment for Chapter 8 on data files will be the C++ part of the of the final exam. See below for some helpful suggestion for writing your C++ final.
Matlab
A lab activity that will demonstrate most of what you learned in Matlab.
Note: Your C++ part of the exam should be finished and points given by me on or before the last day of class. I will be going around the room wrapping up giving credit for a few fixed working programs for Chapter 8 while the class is beginning work on the Matlab activity. I will be kept very busy checking the MATLAB activities durnig the exam period. there will be very little time to look at the C++ portion of the exam. that should be finished and graded by the last day of class.
Some suggestions for the C++ Final Exam:
The template is all in the int main() because it is simple and very easy to understand at one visual glance. In putting your own stamp on this, you must use top down design.
Here are some of the functions you can think about:
- An instructions function with an empty parameter list, (), that tells the user what the program is about and how to use it. This should be the first function call in int main before the while loop that read. the question and answers.
- Inside the loop and after readig both a question and its answer, call a function to display the question and get a response from the user.
- Special note: Do not use cin for the response, use getline(cin, response). Using cin alternatively with getline() causes special problems.
- You need to send the user's response back to the calling function using a reference parameter (&) so the response can be sent into the next function which will deal with right and wrong responses.
- A function dealing with right and wrong responses. Send into this function the question (if you are going to display it again), the correct answer, the response from the user and the variable that you use to count points for correct responses. This last variable needs to be a reference parameter (&) so it can be sent back to use in a function that displays the final score and /or percentage of right out of the total questions.
- A function to calculate the final score or percentage. The variable used to add up the final score of right answers should be sent into this function to be used in the calculation.
- A function to give feed back to the user with encouragements related to the users final results of percentage.
These are only suggestions.
It is most important that you have top down design. Only one task should be performed in any one function. No function should have a lot of code doing different tasks. Call another function if there is another task to perform.
It is important that you demonstrate as much as possible what you have learned in C++ this semester. Don't pad it with unnecessary code, please. In the natural course of doing this project and by making it really useful to yourself and any other user and making it your own unique creation, you will find yourself using many if not most of the skills you have acquired. I will then post these as skill points for you which will contribute to your final grade. 25 points Total
-
| Partial Credit 1 |
Submit unworking code. No skill pts.
Submit data file |
8
5
|
13
|
| Partial Credit 2 |
Code with complete top-down design with minor errors. No skill pts.
Data file completed |
13
5
|
18
|
| Partial Credit 3 |
Working code BUT NOT in complete top-down design.
All three .dat files. No skill points
|
12
3
|
15
|
| Sections |
Skills |
Points |
Total
|
A1 |
Demonstrated code with complete top-down design |
13 |
13 |
A2
|
Attractive review.dat
Attractive output.dat file.
Attractive score.dat file.
|
3
|
16
|
B
|
ID and Specs (complete) |
1 |
17 |
D
|
getline()
|
1 |
18 |
E
|
if-else
else if ladder
switch/case
Logical operators && (and), || (or), ! (not)
Check for bad input |
2 |
20 |
F |
Return type functions
Writing post conditions for every function and writing preconditions only when necessary.
Writing functions with both value and reference parameter |
2 |
22 |
G |
while loop
for loop
do while loop
Sentinel
Counter
Accumulator for sum or product
Nested loops |
3 |
25 |
-
On later inspection of code: -1 point for every extra task in a function that should be performed in another function of its own.
|