Chapter One

MULTIPLE CHOICE

	1.	What does the term hardware refer to?
a.	The relative difficulty of programming	
b.	The physical components that a computer is made of	
c.	The way a computer's storage space is organized	
d.	The logical flow of instructions	
e.	None of the above.	

ANS:	B

	2.	At the heart of a computer is its central processing unit.  The CPU's job is:
a.	To fetch instructions	
b.	To carry out the operations commanded by the instructions	
c.	To produce some outcome or resultant information	
d.	All of the above	
e.	None of the above	

ANS:	D

	3.	Which of the following best describes an operator?
a.	An operator is a rule that must be followed when constructing a program.	
b.	An operator allows you to perform operations on one or more pieces of data.	
c.	An operator marks the beginning or ending of a statement, or is used to separate items in a list.	
d.	An operator is a word that has a special meaning.	
e.	An operator is a symbolic name that refers to a variable.	

ANS:	B

	4.	An Integrated Development Environment typically consists of:
a.	A text editor	
b.	A compiler	
c.	A debugger	
d.	All of the above	
e.	None of the above	

ANS:	D

	5.	The purpose of a memory address is:
a.	To identify the location of a byte in memory	
b.	To prevent multitasking	
c.	To obtain an algorithm	
d.	To improve the effectiveness of high-level languages	
e.	None of the above	

ANS:	A

	6.	The programming process consists of several steps, which include:
a.	Input, Processing, and Output	
b.	Key Words, Operators, and Punctuation	
c.	Design, Creation, Testing, and Debugging	
d.	Syntax, Logic, and Error Handling	
e.	None of the above	

ANS:	C

	7.	Programmer-defined names of memory locations that may hold data are:
a.	Operators	
b.	Variables	
c.	Syntax	
d.	Operands	
e.	None of the above.	

ANS:	B

	8.	Characters or symbols that perform operations on one or more operands are:
a.	Syntax	
b.	Op codes	
c.	Operators	
d.	Program ops	
e.	None of the above	

ANS:	C

	9.	The computer's main memory is commonly known as:
a.	The hard disk	
b.	The floppy disk	
c.	RAM	
d.	Secondary storage	
e.	None of the above	

ANS:	C

	10.	The ________ decodes an instruction and generates electrical signals.
a.	Arithmetic and Logic Unit	
b.	Main memory	
c.	BIOS	
d.	Control Unit	
e.	None of the above	

ANS:	D

	11.	A(n) ____________ is a set of instructions that the computer follows to solve a problem.
a.	Compiler	
b.	Linker	
c.	Program	
d.	Operator	
e.	None of the above	

ANS:	C

	12.	_______________ are used to translate each source code instruction into the appropriate machine language instruction.
a.	Modules	
b.	Library routines	
c.	Compilers	
d.	Preprocessor directives	
e.	None of the above	

ANS:	C

	13.	During which stage does the central processing unit retrieve from main memory the next instruction in the sequence of program instructions?
a.	fetch	
b.	decode	
c.	execute	
d.	portability stage	

ANS:	A

	14.	What statement best describes a variable and its primary purpose?
a.	A variable is a structured, general-purpose language designed primarily for teaching programming.	
b.	A variable is a collection of eight bits.	
c.	A variable is a word that has a special meaning to the compiler.	
d.	A variable is a named storage location in the computer's memory used for holding a piece of information.	
e.	A variable is a "line" of code in the body of a program, that may change.	

ANS:	D

	15.	This step will uncover any syntax errors in your program.
a.	Editing	
b.	Compiling	
c.	Linking	
d.	Executing	
e.	None of these	

ANS:	B

	16.	This term refers to the programmer reading the program from the beginning and steping through each statement.
a.	Pseudocoding	
b.	Software Engineering	
c.	Desk Checking	
d.	Spot Checking	
e.	None of the above	

ANS:	C

	17.	This is used in a program to mark the beginning or ending of a statement, or separate items in a list.
a.	Separators	
b.	Punctuation	
c.	Operators	
d.	Key Words	
e.	None of the above	

ANS:	B

	18.	A set of well-defined steps for performing a task or solving a problem is known as a(n):
a.	Hierarchy	
b.	Algorithm	
c.	Central Processing Unit	
d.	Encoded instruction	
e.	None of the above	

ANS:	B

	19.	The statements written by the programmer are called:
a.	Syntax	
b.	Object code	
c.	Source code	
d.	Runtime libraries	
e.	None of the above	

ANS:	C

	20.	Internally, the CPU consists of two parts:
a.	The Output Device and the Input Device	
b.	The Software and the Hardware	
c.	The Control Unit and the Arithmetic and Logic Unit	
d.	The Single-task Device and the Multi-task Device	
e.	None of the above	

ANS:	C

	21.	Even when there is no power to the computer, data can be held in:
a.	Secondary storage	
b.	The Input Device	
c.	The Output Device	
d.	The Algorithm	
e.	None of the above	

ANS:	A

	22.	Words that have a special meaning and may be used only for their intended purpose are known as:
a.	Operators	
b.	Programmer Defined Words	
c.	Key Words	
d.	Syntax	
e.	None of the above	

ANS:	C

	23.	The name for a memory location that may hold data is:
a.	Key Word	
b.	Syntax	
c.	Operator	
d.	Variable	
e.	None of the above	

ANS:	D

	24.	This is a complete instruction that causes the computer to perform some action.
a.	Line	
b.	Statement	
c.	Variable	
d.	Key Word	
e.	None of the above	

ANS:	B

	25.	A variable declaration announces the name of a variable that will be used in a program, as well as:
a.	The type of data it will be used to hold	
b.	The operators that will be used on it	
c.	The number of times it will be used in the program	
d.	The area of the code in which it will be used	
e.	None of the above	

ANS:	A

	26.	Three primary activities of a program are:
a.	Variables, Operators, and Key Words	
b.	Lines, Statements, and Punctuation	
c.	Input, Processing, and Output	
d.	Integer, Floating-point and Character	
e.	None of the above	

ANS:	C

	27.	An example of a secondary storage device is:
a.	The computer's main memory	
b.	The keyboard	
c.	The monitor	
d.	A hard disk	
e.	None of the above	

ANS:	D

	28.	During which stage does the central processing unit analyze the instruction and encode it in the form of a number, and then generate an electronic signal?
a.	fetch	
b.	decode	
c.	execute	
d.	portability stage	

ANS:	B

	29.	Mistakes that cause a running program to produce incorrect results are called:
a.	Syntax errors	
b.	Logic errors	
c.	Compiler errors	
d.	Linker errors	
e.	None of the above	

ANS:	B

	30.	Computer programs are also known as
a.	hardware	
b.	firmware	
c.	software	
d.	silverware	
e.	None of the above	

ANS:	C

	31.	Unix and Windows 2000 are examples of _______________ operating systems.
a.	single tasking	
b.	multi-tasking	
c.	Macintosh	
d.	command-driven	
e.	None of these	

ANS:	B

	32.	This is a volatile type of memory, used for temporary storage.
a.	A floppy disk	
b.	ALU	
c.	RAM	
d.	A hard disk	
e.	None of the above	

ANS:	C

	33.	This is a set of rules that must be followed when constructing a program.
a.	Syntax	
b.	Punctuation	
c.	Portability	
d.	Operators	
e.	Key words	

ANS:	A

	34.	Which of the following is a preprocessor directive?
a.	pay = hours * rate;	
b.	cin >> rate;	
c.	// This program calculates the user's pay.	
d.	int main()	
e.	#include <iostream>	

ANS:	E

	35.	The programmer usually enters source code into a computer using:
a.	Pseudocode	
b.	A text editor	
c.	A hierarchy chart	
d.	A compiler	
e.	None of the above	

ANS:	B

	36.	In a broad sense, the two primary categories of programming languages are:
a.	Mainframe and PC	
b.	Single-tasking and Multi-tasking	
c.	Low-level and High-level	
d.	COBOL and BASIC	
e.	None of the above	

ANS:	C

	37.	Which of the following is not one of the five major components of a computer system?
a.	Preprocessor	
b.	The CPU (central processing unit)	
c.	Main memory	
d.	Input/Output device	
e.	Secondary storage device	

ANS:	A

	38.	In the process of translating a source file into an executable file, which of the following is the correct sequence?
a.	Source code, preprocessor, modified source code, linker, object code, compiler, executable code.	
b.	Preprocessor, source code, compiler, executable code, linker, modified source code, object code.	
c.	Source code, compiler, modified source code, preprocessor, object code, linker, executable code.	
d.	Source code, preprocessor, modified source code, compiler, object code, linker, executable code.	
e.	Source code, linker, object code, compiler, modified source code, preprocessor, executable code.	

ANS:	D

TRUE/FALSE

	1.	Software engineering is a field that encompasses designing, writing, testing, debugging, documenting, modifying, and maintaining computer programs.

ANS:	T

	2.	Pseudocode is a form of program statement that will always evaluate to "false."

ANS:	F

	3.	In programming, the terms “line” and “statement” always mean the same thing.

ANS:	F

	4.	In C++, key words are written in all lowercase letters.

ANS:	T

	5.	The preprocessor executes after the compiler.

ANS:	F

	6.	Machine language is an example of a high-level language.

ANS:	F

	7.	A CPU really only understands instructions that are written in machine language.

ANS:	T