| Date Assigned: | Wed Oct-18 |
| Date Due: | Thu Oct-19 |
Note: Due to the poor performance on Quiz 4, there will be another quiz (Quiz 5) on Friday, and it will cover the same material as Quiz 4. I strongly urge you to prepare for it (more than you prepared for Quiz 4.
For tomorrow, your homework is:
1. Carefully review the solution to Quiz 4. Don't pretend to review it. Don't just glance at it. STUDY IT. Learn it. Master it. Study each line (each bold line in particular) -- why is it there, what does it do?
2. Put down the solution to Quiz 4. Retake the quiz without looking at the solution. Verify that you now know the material.
3. Due tomorrow, start of class, no late submissions accepted, and no working together on this assignment: write a program which reads in a vector of numbers from the user, then sorts the numbers least-first, then prints out the median, then divides each element in the vector by the median (unless the median is 0, in which case this step is skipped), then prints out the resulting vector. Here is some sample output (yours must match exactly) (user input is underlined) (note: you must use a SIZE constant; this example is run with SIZE=7, though I will run it with other SIZE's as well):
Enter element 1 of 7: 32How to submit: Do not send me email, do not print this out. At the start of class tomorrow, each student will have 30 seconds to demonstrate their working program to me. Grades will be based primarily on correctness, though I will take a quick look at the code for a style grade.
Enter element 2 of 7: 26
Enter element 3 of 7: -3
Enter element 4 of 7: 29
Enter element 5 of 7: 2
Enter element 6 of 7: -47
Enter element 7 of 7: -18The median is: 2
Here are the sorted elements divided by the median:
-23, -9, -1, 1, 13, 14, 16Hit any key to exit.
Good luck.