midterm2003_fall_final_sol_wf

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

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
24 October, 2003 COMP 102 -- Midterm Exam Version A Page 2 of 12
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

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

View Full Document
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 ?
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
Ask a homework question - tutors are online