This lab is worth 10 points and accounts for 12.5 percent of your laboratory grade. The points will be subjectively assigned by your TA based upon whether they believe you made a good faith effort toward complete the tasks that are assigned. Showing up on time, respecting your fellow classmates learning environment, and adherance to laboratory policies also factor into the determination of your score.
The following is an outline of the tasks for you to attempt during the lab period.
A framework containing the files and folders you will need can be found here. Download the .tgz file and decompress it in your account using the command:
tar -xzvf <file_name>
Inside the framework folder you will find a folder named vector_num. In this folder, write a program that creates a vector which contains the odd numbers between 0 and 100, then prints each element of the vector.
Inside the framework folder you will find a folder named array_num. In this folder, write a program that creates an array which contains the even numbers between 0 and 100, then prints each element of the array.
Copy your vector_num folder to a folder named vector_str. In the new folder, alter the program so the user enters a string of text terminated by a single period character. The period should be separated from all other characters by white space. The program should read in whatever the user types and store each word in a separate slot in the vector. Once the program reaches the end of the input,( the period ) the program should print each word it read on a separate line.
If you finish the other tasks, in the folder vofv write a program that creates a vector of vectors( also known as a two dimensional array ). There should be 9 vectors in the vector of vectors. The first should be the multiplication table for 1*1, 1*2, 1*3, ..., 1*9. The second should be the multiplication table for 2*1, 2*2, 2*3, ..., 2*9 and so on. Once you have created the vector of vectors; print them out so that they create the multiplication table.