Chapter 1 

MULTIPLE CHOICE

	1.	Which of the following professions use the computer as a tool?
a.	Accountants	
b.	Engineers	
c.	Mechanics	
d.	Nurses	
e.	All of the above	

ANS:	E

	2.	The computer can do such a wide variety of tasks because:
a.	It can be programmed	
b.	It is a machine	
c.	It contains a central processing unit (CPU)	
d.	It has the ability to connect to the Internet	

ANS:	A

	3.	Computer programming is:
a.	An art	
b.	A science	
c.	Both of the above	
d.	Neither of the above	

ANS:	C

	4.	Another term for programs is:
a.	Hardware	
b.	Software	
c.	Firmware	
d.	Shareware	

ANS:	B

	5.	____________ refers to the physical components that a computer is made of.
a.	Device	
b.	System	
c.	Hardware	
d.	Software	

ANS:	C

	6.	The major components of a typical computer system consist of:
a.	The CPU	
b.	Input/output devices	
c.	Main memory	
d.	Secondary storage devices	
e.	All of the above	

ANS:	E

	7.	A program is a sequence of instructions stored in:
a.	The CPU	
b.	The computer’s memory	
c.	Software	
d.	Firmware	

ANS:	B

	8.	When a computer is running a program, the CPU is engaged in a process formally known as:
a.	The decrypt/validate/commit cycle	
b.	Low-level machine mode	
c.	The fetch/decode/execute cycle	
d.	Parallax data execution	

ANS:	C

	9.	A byte is a collection of:
a.	Four bits	
b.	Six bits	
c.	Eight bits	
d.	A dollar	

ANS:	C

	10.	Which of the following is a secondary storage device?
a.	Hard drives	
b.	Floppy disks	
c.	USB drives	
d.	None of the above 	
e.	All of the above	

ANS:	E

	11.	An operating system can be categorized according to:
a.	The number of users they can accommodate	
b.	The number of tasks they can perform at one time	
c.	Both of the above	
d.	Neither of the above	

ANS:	C

	12.	This is a special language used to write computer programs.
a.	Programming language	
b.	Operating system	
c.	Application	
d.	Pseudocode	

ANS:	A

	13.	The original name for Java was
a.	Java	
b.	HotJava	
c.	Elm	
d.	Oak	

ANS:	D

	14.	Syntax is:
a.	Words that have a special meaning in the programming language	
b.	Rules that must be followed when writing a program	
c.	Punctuation	
d.	Symbols or words that perform operations	

ANS:	B

	15.	Variables are:
a.	Symbolic names made up by the programmer that represents locations in the computer's RAM	
b.	Reserved words	
c.	Symbolic names made up by the programmer whose values cannot be changed	
d.	Operators that perform operations on one or more operands	

ANS:	A

	16.	Byte code instructions are:
a.	Another name for source code	
b.	Syntax errors	
c.	Machine code instructions	
d.	Read and interpreted by the JVM	

ANS:	D

	17.	Suppose you are at an operating system command line, and you are going to use the following command to compile a program:

javac MyClass.java

Before entering the command, you must:

a.	Save the program with the .comp extension	
b.	Execute the java.sun.com program	
c.	Make sure you are in the same directory or folder where MyClass.java is located	
d.	Close all other Windows on your computer system	

ANS:	C

	18.	In the programming process which of the following is not involved in defining what the program is to do:
a.	Process	
b.	Compile code	
c.	Input	
d.	Output	
e.	Purpose	

ANS:	B

	19.	One of the design tools used by programmers when creating a model of the program is:
a.	Disk drive	
b.	Compiler	
c.	ALU	
d.	Pseudocode	

ANS:	D

	20.	A runtime error is usually the result of:
a.	A logical error	
b.	A syntax error	
c.	A compilation error	
d.	Bad data	

ANS:	A

	21.	The purpose of validating the results of the program is:
a.	To create a model of the program	
b.	To correct syntax errors	
c.	To correct runtime errors	
d.	To determine whether the program solves the original problem	

ANS:	D

	22.	This is a software entity that contains data and procedures.
a.	Method	
b.	Object	
c.	Class	
d.	Program	

ANS:	B

	23.	____________ results in only the object's methods being able to directly access and make the changes to the object's data.
a.	Component reusability	
b.	Classes	
c.	Data hiding	
d.	Procedures	

ANS:	C

	24.	Software refers to:
a.	Secondary storage.	
b.	Firmware	
c.	Programs	
d.	Applets	

ANS:	C

	25.	Each different type of CPU has its own:
a.	Syntax	
b.	Firmware	
c.	Machine language	
d.	Software	

ANS:	C

	26.	Internally, the central processing unit (CPU) consists of two parts:
a.	The control unit and the arithmetic and logic unit (ALU)	
b.	The control unit and main memory	
c.	The arithmetic and login unit (ALU) and main memory	
d.	The input and output devices	

ANS:	A

	27.	RAM is usually:
a.	A static type of memory, used for permanent storage	
b.	A volatile type of memory, used only for temporary storage	
c.	Secondary storage	
d.	An input/output device	

ANS:	B

	28.	Application software refers to:
a.	The operating system	
b.	Pseudocode	
c.	Key words	
d.	The programs that make the computer useful to the user	

ANS:	D

	29.	A computer program is:
a.	A set of instructions that enable the computer to solve a problem or perform a task.	
b.	Main memory	
c.	Pseudocode	
d.	A flow chart	

ANS:	A

	30.	Java was developed by
a.	Microsoft.	
b.	IBM	
c.	Sun Microsystems	
d.	Hewlett-Packard	

ANS:	C

	31.	Key words are:
a.	The data names in your program	
b.	Words that have a special meaning in the programming language	
c.	Symbols or words that perform operations on one or more operands	
d.	Words or names defined by the programmer	

ANS:	B

	32.	These are used to indicate the end of a Java statement.
a.	Semicolons	
b.	Colons	
c.	Periods	
d.	Asterisks	

ANS:	A

	33.	Because Java byte code is the same on all computers, compiled Java programs
a.	Must be re-compiled for each different machine it is run on	
b.	Cannot run on Linux systems	
c.	Are non-existent	
d.	Are highly portable	

ANS:	D

	34.	Which of the following will compile a program called ReadIt?
a.	java ReadIt.java	
b.	java ReadIt.javac	
c.	javac ReadIt.java	
d.	javac ReadIt.javac	

ANS:	C

	35.	Which of the following will run the compiled program ReadIt?
a.	java ReadIt.java	
b.	java ReadIt	
c.	run ReadIt	
d.	go ReadIt	

ANS:	B

	36.	Which of the following is not part of the programming process?
a.	Design	
b.	Testing	
c.	Debugging	
d.	All the above are parts of the programming process	

ANS:	D

	37.	This is a cross between human language and a programming language.
a.	Pseudocode	
b.	Java	
c.	The Java Virtual Machine	
d.	The compiler	

ANS:	A

	38.	This is a set of programming language statements that, together, perform a specific task.
a.	Object	
b.	Compiler	
c.	Procedure	
d.	Pseudocode	

ANS:	C

	39.	The data contained in an object is known as:
a.	Methods	
b.	Attributes	
c.	Classes	
d.	Atriums	

ANS:	B

TRUE/FALSE

	1.	The computer is a tool used by so many professions that it cannot be easily categorized.

ANS:	T

	2.	Without programmers, the users of computers would have no software, and without software, computers would not be able to do anything.

ANS:	T

	3.	Application software refers to programs that make the computer useful to the user.

ANS:	T

	4.	Colons are used to indicate the end of a Java statement.

ANS:	F

	5.	When an object’s internal data is hidden from outside code and access to that data is restricted to the object's methods, the data is protected from accidental corruption.

ANS:	T

	6.	Each byte is assigned a unique number known as an address.

ANS:	T

	7.	The Java Virtual Machine is a program that reads Java byte code instructions and executes them as they are read.

ANS:	T

	8.	The contents of a variable cannot be changed while the program is running.

ANS:	F

	9.	Logical errors are mistakes that cause the program to produce erroneous results.

ANS:	T

	10.	Encapsulation refers to the combining of data and code into a single object.

ANS:	T

	11.	Compiled byte code is also called source code.

ANS:	F

	12.	Java source files end with the .class extension.

ANS:	F