Quiz #3 Solutions

Quiz #3 Solutions - 1 CSE 100 Principles of Programming...

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

View Full Document Right Arrow Icon
CSE 100: Principles of Programming with C++ Department of Computer Science, Arizona State University Fall 2007, Quiz 3 - Solutions 20 Points Part I: True/False Indicate whether the statement is true or false. Each question worth 1 point 1. Suppose found = true and num = 6 . The value of the expression (!found) || (num > 6) is false . : True 2. Every if statement must have a corresponding else . : False 3. The output of the following code is 10 . : False num = 5; if (num >= 5) cout << num <<endl; else cout << num + 5 << endl; 4. The output of the following C++ code is: Num is greater than 10 : False num = 20; if (num <= 10) if (num >= 0) cout << "Num is between 0 and 10" << endl; else cout << "Num is greater than 10" << endl; 5. In C++, case is a reserved word, but break is not a reserved word.: False 6. The output of the following C++ code is Legal Age .: True age = 50; switch (age > 21) { case true: cout << "Legal Age"; break; case false: cout << "Below Legal Age"; break; default: cout << "Bad Input"; } 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Part II: Identify the choice that best completes the statement or answers the question. Each ques-
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.

This note was uploaded on 04/29/2008 for the course CSE 100 taught by Professor Computersystems during the Fall '07 term at ASU.

Page1 / 3

Quiz #3 Solutions - 1 CSE 100 Principles of Programming...

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