test 1 comp sci - 1. Before a variable in C+ is used, it...

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

View Full Document Right Arrow Icon
1. Before a variable in C++ is used, it must be Student Response Valu e Correct Answer a. defined 100% b. initialized 0% c. used in some expression 0% d. begin with a capital letter 0% e. contain only letters, digits and underscores. 0% Score: 2/2 2. Which of the following types are not built into the C++ language: Student Response Valu e Correct Answer a. bool 0% b . real 100% c. short 0% d. int 0% e. long 0% f. double 0% Score: 2/2 3. Which of the following are not legal definitions with initializations? (Consider each line
Background image of page 1

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

View Full DocumentRight Arrow Icon
to be in a different scope so there is no multiple definition of identifiers.) Student Response Valu e Correct Answer a. int count = 0, limit = 19; 0% b. int count(0), limit(19); 0% c. int count = 0, limit(19); 0% d. int limit = 19; 0% e. int namespace(0); 100% Score: 0/2 4. The value of the expression 20.0 * (9/5) + 32.0 is Student Response Valu e Correct Answer a. 68.0 0% b . 52.0 100% c. incorrect expression so there is no value 0% d. 32.0 0% e. incorrect expression , the / should be % 0% Score: 2/2 5. . The following #include statements correct?
Background image of page 2
Student Response Valu e Correct Answer a. #include <iostream> 100% b. #include < iostream> 0% c. #include 'MyStream.h' 0% d. #include "cctype " 0% e. #include "This file does not exist on the system" 0% Score: 2/2 6. Which control construct repeats a sequence of statements zero or more times? Student Response Valu e Correct Answer a. while statement 100% b. do-while statement 0% c. switch statement 0% d. if-else statement 0% Score: 2/2 7. What is the value of the bool valued expression, 1 < x < 10? Does the value of this depend on the value of x? Explain, and give the expression that the programmer probably meant.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Student Response Valu e Correct Answer a. This statement is incorrect as it is always false. 0% b. This statement is correct and its value depends on x. 0% c. This statement is incorrect and it is always true 100% d . This statement is incorrect, but it does depend on the value of x. 0% Score: 0/2 8. Student Response Valu e Correct Answer a. It has two operands. 0% b. It can have one operand. 0% c. It uses short circuit evaluation. 0% d . a and c are correct 100% e. b and c are correct 0% Score: 2/2 9. Which of the following is not true of the || operator?
Background image of page 4
Valu e Correct Answer a. It has two operands. 0% b. It can have one operand. 100% c. It is the logical OR operator. 0% d. It returns true if either operands is true. 0% e. It uses short circuit evaluation. 0% Score: 0/2 10. In a switch statement, when a break statement is encountered, an immediate transfer of control is made to Student Response Valu e Correct Answer a. the default case of the switch statement 0% b. a goto statement 0% c. the else clause 0% d. the statement beyond the end of the switch statement. 100%
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/22/2008 for the course MUED 4342 taught by Professor D.kretchmer during the Fall '07 term at University of Houston.

Page1 / 26

test 1 comp sci - 1. Before a variable in C+ is used, it...

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

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