EECS W09+Exam+1+Part+1

EECS W09+Exam+1+Part+1 - EECS 183 Winter 2009 Exam 1 Part 1...

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

View Full Document Right Arrow Icon
EECS 183 Winter 2009 Exam 1 Part 1 (100 points) Closed Book Closed Notes Closed Electronic Devices Closed Neighbor Multiple Choice Questions Instructions: Read Carefully This is a closed book exam. You may not refer to any materials during the exam. 1. Some questions are not simple—read carefully. 2. Assume all code and code fragments compile, unless otherwise specified. 3. Assume/use only the standard ISO/ANSI C++. 4. Questions asking if a statement is “valid” are asking if the code can compile—a statement is still valid if there is a warning when it is compiled 5. This course operates under the rules of the College of Engineering Honor Code. Your signature endorses the pledge below. After you finish your exam, sign your scantron sheet to indicate the statement below: I have neither given nor received aid on this examination, nor have I concealed any violations of the Honor Code.
Background image of page 1

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

View Full DocumentRight Arrow Icon
1. Consider the following code fragment: int a, b; cin >> a >> ‘-‘ >> b; cout << a – b; If the user types 5-4 a) 1 and presses ENTER, what is displayed on the screen? b) 5-4 c) 5 d) a-b e) This code does not compile 2. To what does the C++ expression 5+3 % 5-2 a) 2 evaluate? b) 6 c) 1 d) 5 e) This code does not compile 3. To what does the C++ expression 5+3.0 % 5-2 a) 2 evaluate? b) 6 c) 1 d) 5 e) This code does not compile 4. Which of the following is an invalid variable declaration? a) int two_words; b) double Capital; c) int 3rdNumber; d) char last; 5. Consider the following code fragment: double u = 4 / 2; This code fragment will: a) Compile and run without error b) Fail to compile c) Compile successfully but have an error when running d) Cause smoke to come out of the computer
Background image of page 2
6. Consider the following code fragment:
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 / 11

EECS W09+Exam+1+Part+1 - EECS 183 Winter 2009 Exam 1 Part 1...

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