Saturday, September 1, 2007

Simple C++ Quiz

Computer memory is called RAM because:

[A] It provides rapid access to data

[B] It is mounted on the motherboard

[C] It is measured in megabytes

[D] Its bytes can be addressed in random order (correct answer)

[E] Its chips are mounted in a rectangular array



What is the debugger used for?

[A] Removing comments from the source code

[B] Running and tracing programs in a controlled way (correct answer)

[C] Running diagnostics of hardware components

[D] Removing syntax errors from C++ programs

[E] Removing dust from the computer screen



Which program helps programmers create and modify source code?

[A] Editor (correct answer)

[B] Make

[C] Compiler

[D] Linker

[E] None of the above



Which program converts source code into object modules?

[A] Editor

[B] Make

[C] Compiler (correct answer)

[D] Linker

[E] None of the above



Which program converts object modules into an executable program?

[A] Editor

[B] Make

[C] Compiler

[D] Linker (correct answer)

[E] None of the above



Data files read by a program are read when that program is:

[A] Compiled

[B] Linked

[C] Loaded into RAM

[D] Executed (correct answer)

[E] Run for the first time



The complexity of a program is often measured by:

[A] The number of lines in the source file (correct answer)

[B] The time it took to write it

[C] The time it takes to run

[D] The number of data files it reads

[E] None of the above



How many reserved words are there in C++?

[A] 5-10

[B] 15-20

[C] 25-50 (correct answer)

[D] Over 100

[E] All words that start with a #



True or False: CPU instructions are stored in a special area of computer memory reserved for all programs.

[A] True

[B] False (correct answer)



You are hired to write a gradebook program. What is the first step in developing this program?

[A] Create the exact program specifications (correct answer)

[B] Create the necessary algorithms

[C] Create a "stubs" program to check for global execution flow

[D] Gather all the necessary grades and other input files

[E] Write the main body of the program with function calls for all the major modules



Consider the following statement: (Blank) is the concept of thinking about programming features and using programming features without concern, or knowledge about the implementation of such features.

[A] information hiding (correct answer)

[B] top-down design and step-wise refinement

[C] object oriented programming

[D] data abstraction

[E] encapsulation



A team of programmers works together on a large project. Each individual team member is assigned to create, write, and test a large function. Which of the following is required information for each programmer to complete his/her assigned task?
I: Complete program specifications, including any input/output requiremens
II: Preconditions and postconditions of the assigned function
III: Parameter list of the assigned function that interfaces with the rest of the program

[A] I only

[B] II only

[C] III only

[D] II and III only (correct answer)

[E] I, II, and III



True or False: The char data type is used for variables that hold character strings.

[A] True

[B] False (correct answer)



True or False: The typedef statement is used to define the size of variables of a particular built-in type.

[A] True

[B] False (correct answer)



True or False: The same name can be used for an integer and a double variable in the same function.

[A] True

[B] False (correct answer)



True or False: Each variable must be declared on a separate line.

[A] True

[B] False (correct answer)



All variables must always be declared at the top of the function's body.

[A] True

[B] False (correct answer)



True or False: It is considered a good practice for a beginning programmer to use only global variables.

[A] True

[B] False (correct answer)



True or False: It is acceptable to use the same name for local variables in different functions.

[A] True (correct answer)

[B] False

No comments: