COMP-202--final-exam--2009-04.pdf

50 views24 pages
11 Apr 2012
School
Course

First Name:Last Name:
McGill ID:Section:
Faculty of Science
COMP-202B - Introduction to Computing I (Winter 2009) - All Sections
Final Examination
Wednesday, April 29, 2009 Examiners: Mathieu Petitpas [Section 1]
9:00–12:00 Prof. Xue Liu [Section 2]
Ekwa J. Duala-Ekoko [Section 3]
Instructions:
This is a closed book ﬁnal examination; notes, slides, textbooks, and other forms of documentation
are not allowed.
Non-programmable calculators are allowed (though you should not need one).
Computers, PDAs, cell phones, and other electronic devices are not allowed.
Answer all questions on this examination paper and return it. If you need additional space, use
pages 21-22 or the booklets supplied and clearly indicate where each question is continued. In order
to receive full marks for a question, you must show all work.
This ﬁnal examination has 24 pages including this cover page, and is printed on both sides of the
paper. Pages 23-24 contain information about useful classes and methods.
1 2 3 Subtotal
/10 /5 /5 /20
4 5 6 Subtotal
/10 /10 /10 /30
7 8 9 Subtotal
/15 /20 /15 /50
Total
/100
1
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 24 pages and 3 million more documents.

COMP-202B - Winter 2009 - Final Examination Page 2
Section 1 - Short Questions
1. In one or two sentences, explain the differences between the concepts in each of the following pairs.[10]
BE BRIEF; overly long answers will be grounds for mark deductions.
(a) An if statement and a while statement
(b) Classes and objects
(c) Instance variables and class (or static) variables
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 24 pages and 3 million more documents.

COMP-202B - Winter 2009 - Final Examination Page 3
(d) An array and an ArrayList
(e) Checked exceptions and unchecked exceptions
2. The most common method students encounter in this course is the main() method; its header can[5]
have slight variations but is usually the following:
public static void main(String[] args)
In one or two sentences, describe what each of the following elements of the header of the main()
method means. BE BRIEF; overly long answers will be grounds for mark deductions.
(a) public
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 24 pages and 3 million more documents.

Get access

\$10 USD/m
Billed \$120 USD annually
Homework Help
Class Notes
Textbook Notes