worksheet1 - Worksheet 1 Numbers in square brackets at the...

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

View Full Document Right Arrow Icon
Worksheet 1 Numbers in square brackets at the beginning of a question indicate that the question is from chapter 2 of the text, and the number in the brackets is the corresponding question number. Some questions refer to example programs that have been or will be written in class - you should wait until the programs are written in class before submitting your answers. Submit your answers on Chi-Tester. ONCE YOU START YOUR CHI-TESTER SESSION, YOU CANNOT CLOSE IT AND RESTART - TRANSFER ALL OF YOUR ANSWERS FROM THIS WORKSHEET TO CHI-TESTER AT ONE TIME. 1. [1] Dividing a program into functions a. is the key to object-oriented programming. b. makes the program easier to conceptualize. c. may reduce the size of the program. d. make the program run faster. 2. [2] A function name must be followed by ______ . a. { and } b. [ and ] c. ( and ) d. < and > 3. [3] A function body is delimited by ______ . a. { and } b. [ and ] c. ( and ) d. < and > 4. [5] A C++ instruction that tells the computer to do something is called a(n) _____ . a. expression b. statement c. declaration d. command 5. [7] An expression a. usually evaluates to a numerical value. b. indicates the emotional state of the program. c. always occurs outside a function. d. may be part of a statement.
Background image of page 1

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

View Full DocumentRight Arrow Icon
[9] A variable of type char can hold the value 301. a. true b. false 7. [10 a] What kind of program element is 12 ? a. integer constant b. character constant c. floating-point constant d. variable name or identifier e. function name f. malformed or otherwise incorrect code 8. [10 b] What kind of program element is 'a' a. integer constant b. character constant c. floating-point constant d. variable name or identifier e. function name f. malformed or otherwise incorrect code 9. [10 c] What kind of program element is 4.28915 a. integer constant b. character constant c. floating-point constant d. variable name or identifier e. function name f. malformed or otherwise incorrect code 10. [10 d] What kind of program element is JungleJim a. integer constant
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 02/27/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 7

worksheet1 - Worksheet 1 Numbers in square brackets at the...

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