{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm2003_fall_final_sol_wf

midterm2003_fall_final_sol_wf - 24 October 2003 COMP 102...

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 2 of 12
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
Image of page 3

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

View Full Document Right 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 ?
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern