Tut_3 - objects and look like such: a b c d e f g h i The...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming & Data Structures Tutorial 3 1. Define a function that given 2 index positions in an array will swap the elements in those index positions around. The function prototype will look like such: void swap (int array[], int pos1, int pos2); 2. Given an integer array N, N > 0, write a function that finds the largest/smallest element in the list. Write a client program to test your function. 3. In computer graphics, movement of objects in a 3d world are represented using matrices and vectors. One use of matrices is used for specifying rotations of
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: objects and look like such: a b c d e f g h i The addition of 2 matrices is just simply : a b c a b c a+a b+b c+c d e f + d e f = d+d e+e f+f g h i g h i g+g h+h i+i Matrices can be define in C++ by using an 2-d array. Using an 2-d array define a matrix structure and write a function that will get the sum of two matrices. 4. Write a function to print out the contents of your matrix. Test your functions by writing a test client program....
View Full Document

Ask a homework question - tutors are online