midterm2003_fall_final_sol_wf

midterm2003_fall_final_sol_wf - 24 October, 2003 COMP 102 -...

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

View Full Document Right Arrow Icon
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 1 of 12 THE HONG KONG UNIVERSITY OF SCIENCE AND TECHNOLOGY Department of Computer Science COMP 102: Computer and Programming Fundamentals I Fall 2003 Midterm Examination (All Sections) Date: 24 October, 2003 This exam contains 10 questions on 11 pages. Please count the pages. You have 2 hours to complete this exam. Instructions 1. This is a closed-book, closed-notes examination. 2. Check that you have all 11 pages (including this cover page). 3. Write your name, student number, lecture and lab sections on this page. 4. Answer all questions in the box provided using a ball point pen. 5. Please turn off your mobile phone/pager or else you will be disqualified. 6. No electronic devices (including calculators, PDA, dictionaries, etc.) Problem Your point s Max point s Problem Your point s Max point s 1 5 6 8 2 5 7 11 3 10 8 10 4 20 9 8 5 12 10 11 Subtotal 52 Subtotal 48 Your total points 100 Please identify yourself: Lab section Name Student Id Signature
Background image of page 1

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

View Full DocumentRight Arrow Icon
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 2 of 12
Background image of page 2
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 3 of 12 1. (5 points) Which of the following lines contains a valid C++ identifier? (Write True or False in the corresponding boxes). A. SHENZHOU#5 B. SHEN_ZHOU_5 C. SHENZHOU5! D. Oct_24_2003 E. 24_Oct_2003 2. (5 points) Given int a = 1, b = 4, c = 6, d = 2, x = 2, y = 3, z = 2 ; What is the value of each of the following expressions? a) (4 + 5 * a >= b – 4) || (c – 8)_______ true _______ b) c%x || b == 9/z && (d – 3) ________ true _______ c (c / d ) && (y > 5/2) ________ true ________ d) a/b + y-- ________ 3 ___________ e) ++x - --z ________ 2 ___________ False True True False False
Background image of page 3

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

View Full DocumentRight Arrow Icon
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 4 of 12 3. (10 points) What is the value of n after each of the following C++ statements are executed ?
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/30/2010 for the course COMP COMP102 taught by Professor Lrr during the Fall '09 term at HKUST.

Page1 / 12

midterm2003_fall_final_sol_wf - 24 October, 2003 COMP 102 -...

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

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