fin07w - April 2007 Final Examination VERSION 1 COMP 208 -...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
April 2007 Final Examination VERSION 1 COMP 208 -- Computers in Engineering Monday, April 23, 2007 9:00 – 12:00 A.M. Examiner: Prof. Nathan Friedman Assoc Examiner: Prof. Yi Lin Student Name: McGill ID: INSTRUCTIONS: This is a CLOSED BOOK examination. This examination consists of 20 multiple choice questions and 2 (two) programming questions, for a total of 22 questions. o The Examination Security Monitor Program detects pairs of students with unusually similar answer patterns on multiple-choice exams. Data generated by this program can be used as admissible evidence, either to initiate or corroborate an investigation or a charge of cheating under Section 16 of the Code of Student Conduct and Disciplinary Procedures. Mark your multiple choice answers on the computer sheet using PENCIL ONLY. Answer questions 21 and 22 in the examination booklet provided. The examination consists of 13 pages including the cover page. FACULTY STANDARD CALCULATOR permitted ONLY. This examination paper and answer booklets MUST BE RETURNED Grading: o Questions 1 – 7 are worth 2 marks each o Questions 8 – 13 are worth 3 marks each o Questions 14 – 20 are worth 4 marks each o Questions 21 and 22 are worth 20 marks each COMP 208 1 of 1 April 23, 2007 Final Examination Version 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Question 1 Which of the following statements (a – d) about function prototypes in C is false? a) The prototype must include the type of the value returned. b) The prototype must include the name of the function. c) The prototype must include the name of each parameter. d) The prototype must include the type of each parameter. e) All of the statements are true. Question 2 Consider the C declaration: float *x; Which of the following statements is false? a) x is a memory cell containing a real value. b) x is a memory cell containing the address of another memory cell. c) x can be a pointer to an array of real values. d) The compiler allocates a memory cell for the value of x. e) The value of x is not defined after executing the declaration. Question 3 Suppose you sort the following values using mergesort: 68 13 61 58 56 17 74 8 59 4 The values in the array just before the final merge step will be: a) 13 68 58 61 17 56 8 17 4 56 b) 13 56 58 61 68 4 8 17 59 74 c) 13 56 58 61 74 4 8 17 59 68 d) 4 8 13 17 56 58 59 68 61 74 e) 4 13 8 58 17 56 74 61 59 68 Question 4 Suppose the selection sort algorithm is applied to sort the array: {3, 5, 8, 4, 2, 1, 7, 6} into increasing order from left to right. What will be the arrangement of the elements after the first two passes? a) 1, 2, 3, 5, 8, 4, 6, 7 b) 3, 5, 8, 4, 2, 1, 7, 6 c) 1, 2, 8, 4, 5, 3, 7, 6 d) 3, 4, 5, 8, 1, 2, 6, 7 e) None of the above COMP 208 2 of 2 April 23, 2007 Final Examination Version 1
Background image of page 2
Question 5 Suppose the insertion sort algorithm is applied to sort the array: {3, 5, 8, 4, 2, 1, 7, 6} into increasing order from left to right. What will be the arrangement of the elements after the
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

fin07w - April 2007 Final Examination VERSION 1 COMP 208 -...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online