Week 3-4 Programming Assignment
Core Learning Outcomes addressed in this assignment:
- Demonstrate creativity and problem-solving skills. (9)
- Write C++ programs that use proper style and documentation. (10)
- Write C++ programs that use Pointers and dynamic memory allocation. (11)
- Write C++ programs that uses Function Templates. (11)
- Its is C++ program
Grading Information: This Lab Homework is worth 76 points and due by Sunday of week 4 at midnight CST.
The purpose of this assignment is to assess if you can create a program that uses pointers, templates, and dynamic memory allocation.
Two files are required to make this program work, d_random.h and d_vector.h.
Both files are available in the “Doc Sharing” area.
|The file must be called week3-4Prog.cpp
This program will store in miniVector v a list of 15 random integers from 0 to 99, then it will output the vector, sort the vector, then output it again sorted. The miniVector class is on page 250.
1. Create program definition with the following templates and methods:
// output miniVector v
1. Declare: miniVector<int> v;
After you output the sorted vector:
|writeMiniVector Method (const miniVector<T>& v)
1. Iterate through the vector v and output each element to the screen.
|sortMiniVector Method (miniVector<T>& v)
1. Sort the elements of vector v.
|Ensure you include ALL .cpp file(s) and any associated, student-defined .h (header) files required to make your program compile and run. The only files in the dropbox should be .cpp and .h files. Do not turn in .zip, .exe, .rar, etc files.||10|
|Upload your page to the Dropbox.
NOTE: Complete your activity and submit it to the Dropbox by clicking on the Dropbox tab at the top of the course frame and choosing the correct Weekly Activity.
If needed, click on the Help button above for more information on Course Tools/Using the Dropbox.
Total Possible Points
|Example output of your program
Original: 59 18 60 91 49 47 83 93 55 52 15 36 83 56 91