Exam #2 Review
(Last Mod: 27 November 2010 21:38:42 )
Bookmarks:
In addition to the topics covered on Exam #1, A review of the Course Syllabus shows that the following topics are fair game for the exam:
Pointers and pointer arithmetic.
Pointers as arguments to functions.
Pointers and multidimensional array.
Pointers to pointers.
Command Line arguments.
Storage classes, particularly auto and static.
File operations - opening/closing
Formatted I/O
Unformatted I/O
Typedef Statements
Structures
Compile-time versus Run-time storage allocation
Dynamic memory allocation.
Linked Lists
The exam will consist of a number of multiple choice or short answer questions followed by a few simple problem solving questions. As per the Course Policies, one fourth of the exam (in terms of points) will come from the odd numbered end-of-section exercises in the text verbatim, one fourth of the exam will come from the even numbered end-of-section exercises in the text verbatim, and one fourth of the exam will be taken from Prior Exams, Prior Review Sheets, and this Review Sheet verbatim.
There will be 20 multiple choice questions on the exam worth two points each. All will come from the Multiple Choice Question Bank found on the website.
There will be eleven additional questions on the exam organized as follows. Most of these fall into the category of "Short Answer" questions. Each will be worth either 5pt or 10pt. There will be six five-point problems and five ten-point. The total, when added to the 40 points from the Multiple Choice, will therefore be 120 pts. You are to mark two five-point problems and one ten-point problem that will be excluded from the grading. If you do not mark the correct number of problems, then your selection will be corrected by removing marks beginning with the first marked problem or by adding marks beginning with the last problem.
Extra Credit (10 points)
Write a structure definition for a structure named VECTOR that has two elements. The first is an integer giving the dimension of the vector and the second is a pointer to a dynamically allocated array of type double of the given dimension.
Use a typedef statement to create an alias for "struct VECTOR" known as "VECTOR". Write a set of primitive functions than can be used to create a new VECTOR structure, free an existing VECTOR structure, and to set and retrieve any of its member elements. The function that sets the dimension should also allocate (or reallocate as appropriate) sufficient memory to store all of the components of the vector.
Write a function called DotProduct() that takes pointers to two structures of type VECTOR and returns the vector dot product of the two structures.