{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ENG1D04_Midterm_VersionA_NoSolution

# ENG1D04_Midterm_VersionA_NoSolution - ENGINEER 1D04 Midterm...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SFWR ENG 2AA4 2/17 Question 1 [1 mark] An algorithmic solution of a problem is the solution that can be reached A Heuristically on the basis of the developer’s experience B Through a direct set of steps C By analyzing field data D Using advanced computational methods E All of the above Question 2 [1 mark] Consider the following method for swapping (switching) the values of two variables: 1 void swap(double x, double y) 2 { 3 double z; 4 z = x; 5 x = y; 6 y = z; 7 } Which line of the program contains an error? A 1 B 3 C 4 D 5 E There is no error continued on page 3
SFWR ENG 2AA4 3/17 Question 3 [1 mark] Which of the following code fragments produces a loop that will repeat statement S as long as a b c ? 1. while ((a<=b)&&(b<=c)) { S } 2. if (a <= b <= c) { do { S } while (a <= b <= c); } 3. while (a <= b) { while (b <= c) { S } } A Fragment 1 B Fragment 2 C Fragment 3 D Fragment 1 and 2 E All of the fragments continued on page 4

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SFWR ENG 2AA4 4/17 Question 4 [1 mark] A matrix (two dimensional array) that is important in many applications, such as in signal processing, is the Toeplitz matrix. A Toeplitz matrix is one where all elements on a diagonal are equal. If we have the values r o , ..., r N - 1 , ..., r 2 N - 2 , then we can construct an N × N Toeplitz matrix. For instance, if N = 4, then the matrix would be: T = r 3 r 4 r 5 r 6 r 2 r 3 r 4 r 5 r 1 r 2 r 3 r 4 r 0 r 1 r 2 r 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 17

ENG1D04_Midterm_VersionA_NoSolution - ENGINEER 1D04 Midterm...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online