

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CSCI 340 Computer Assignment 1 Spring 2016
For this computer assignment, you are to write a C++ program to generate random integers in the range [ LOW = 1, HIGH = 1000 ] and to store them in
and display it on standard output. The main () routine is already provided for you. sort( ) function from the STL is used to sort the contents of the vector. You are required to implement the following routines in your program:
This routine generates vec_size random integers and puts them in
line, except perhaps the last line. The sorted numbers need to be properly aligned on the output. For each printed number, allocate ITEM_W = 6 spaces on standard output. Programming Notes:
program only contains three functions: genRndNums, printVec, and main. main is already implemented. You can obtain the partially implemented assignment1.cc from the directory
any necessary headers and add necessary global constants.
constant value RAND_MAX is the largest random integer returned by
assignment1.exe”. This will create the executable file
last page. Add documentation to your source file.
command “make” to compile your source file and produce the executable file.
your TA by following the Assignment Submission Instructions.