Quiz #2 Solutions

Quiz #2 Solutions - Page 1 of 3 CSE 100 Principles of...

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

View Full Document Right Arrow Icon
Page 1 of 3 CSE 100: Principles of Programming with C++ Department of Computer Science Arizona State University Fall 2007 Quiz 2 20 Points True/False [7 points] Indicate whether the statement is true or false. Each question worth 1 point 1. The following is a legal C++ identifier: First_Name True 2. The maximum number of significant digits in values of the double type is 15. True 3. Multiplication and division have the same operator precedence. True 4. If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right. False (Apply operator precedence rules) 5. A mixed arithmetic expression contains all operands of the same type. False 6. In C++, the value of the expression 32/5.0 is 6.4. True 7. The value of a variable cannot change during program execution. False Short Answers [7 points] 8. Suppose x = 6.7. What is the output of the statement [1.5 points] cout << static_cast<int>(x + 0.5) << endl;
Background image of page 1

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

View Full Document Right Arrow Icon
Page 2 of 3 static_cast<int>(6.7 + 0.5) = > static_cast<int>(7.2) = >
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Quiz #2 Solutions - Page 1 of 3 CSE 100 Principles of...

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

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