Exam #2 Review

(Last Mod: 27 November 2010 21:38:42 )

ECE-1021 Home


Bookmarks:


Topics Covered

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

Exam Format and Guidelines

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. 

  1. One of the following:
    1. Section 1.3 Exercise 14
    2. Section 1.3 Exercise 17
    3. Section 1.3 Exercise 18
    4. Section 1.3 Exercise 25
    5. Section 1.3 Exercise 27
  2. One of the following:
    1. Section 4.11 Exercise 6
    2. Section 4.11 Exercise 7
    3. Section 4.11 Exercise 8
    4. Section 4.11 Exercise 9
    5. Section 4.11 Exercise 10
  3. One of the following:
    1. Section 5.3 Exercise 4
    2. Section 5.8 Exercise 1
    3. Section 5.8 Exercise 3
  4. One of the following:
    1. Section 6.1 Exercise 4
    2. Section 6.2 Exercise 10
    3. Section 6.2 Exercises 19-22
    4. Section 6.2 Exercise 24
    5. Section 6.8 Exercise 7
  5. One of the following:
    1. Section 7.1 Exercises 8-16
    2. Section 7.2 Exercises 5
    3. Section 7.2 Exercises 6
    4. Section 7.2 Exercises 7
    5. Section 7.2 Exercises 8
  6. One of the following:
    1. Section 7.3 Exercises 8
    2. Section 7.3 Exercises 9
    3. Section 7.3 Exercises 10
    4. Section 7.3 Exercises 15
    5. Section 7.3 Exercises 18
  7. One of the following:
    1. Section 7.6 Exercise 5
    2. Section 7.6 Exercise 6
    3. Section 7.6 Exercise 7
    4. Section 7.6 Exercise 8
    5. Section 7.6 Exercise 9
  8. One of the following:
    1. Section 8.1 Exercise 4
    2. Section 8.1 Exercise 5
    3. Section 8.1 Exercise 6
    4. Section 8.1 Exercise 4
  9. One of the following:
    1. Section 9.5 Exercise 8
    2. Section 9.5 Exercise 9
    3. Section 9.5 Exercise 10
    4. Section 9.5 Exercise 11
  10. One of the following:
    1. Section 10.1 Exercise 1
    2. Section 10.1 Exercise 2
    3. Section 10.2 Exercise 1
    4. Section 10.2 Exercise 2
    5. Section 10.2 Exercise 3
  11. One of the following:
    1. Section 11.1 Exercise 7
    2. Section 11.1 Exercise 8
    3. Section 11.1 Exercise 9
    4. Section 11.1 Exercise 10

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.