Chapter 1 Exam
Name___________________________________
 
MULTIPLE CHOICE.  Choose the one alternative that best completes the statement or answers the question. 
1) 

Whereas ________ is centered on creating procedures, _________ is centered on creating objects. 

1) 

_______ 
A) 

Procedural programming, Object-oriented programming 
B) 

Object-oriented programming, Procedural programming 
C) 

Routine programming, method programming 
D) 

Procedural programming, Class programming 

 
2) 

Which of the following will run the compiled program ReadIt? 

2) 

_______ 
A) 

run ReadIt 

B) 

java ReadIt.java 

C) 

java ReadIt 

D) 

go ReadIt 

 
3) 

RAM is usually 

3) 

_______ 
A) 

An input/output device 
B) 

A volatile type of memory, used only for temporary storage 
C) 

Secondary storage 
D) 

A static type of memory, used for permanent storage 

 
4) 

The two primary methods of pragramming in use today are 

4) 

_______ 
A) 

Procedural 

B) 

Object oriented 
C) 

Both A and B 

D) 

Method and procedures 

 
5) 

The purpose of validating the results of the program is 

5) 

_______ 
A) 

To determine if the program solves the original problem 
B) 

To correct runtime errors 
C) 

To create a model of the program 
D) 

To correct syntax errors 

 
6) 

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: 

6) 

_______ 
A) 

Close all other Windows on your computer system 
B) 

Make sure you are in the same directory or folder where the MyClass.java file is located 
C) 

Execute the java.sun.com program 
D) 

Save the program with the .comp extension 

 
7) 

An object typically hides it data, but allows outside code to access 

7) 

_______ 
A) 

The pseudocode 

B) 

The methods that operate on the data 
C) 

Private data members 

D) 

The data files 

 
8) 

Software refers to 

8) 

_______ 
A) 

Programs 
B) 

The physical components that a computer is made of. 
C) 

Firmware 
D) 

Peopleware 

 
9) 

Variables are 

9) 

_______ 
A) 

Symbolic names made up by the programmer whose values cannot be changed 
B) 

Operators that perform operations on one or more operands 
C) 

Symbolic names made up by the programmer that represents locations in the computer's RAM 
D) 

Reserved words 

 
10) 

Which of the following is not part of the programming process 

10) 

______ 
A) 

Design/model 
B) 

Debugging/correcting errors 
C) 

Testing 
D) 

All the above are parts of the programming process 

 
11) 

An object typically hides it data, but allows outside code to access 

11) 

______ 
A) 

The pseudocode 

B) 

Private data members 
C) 

The data files 

D) 

The methods that operate on the data 

 
12) 

The major components of a typical computer system consist of 

12) 

______ 
A) 

Input/output devices 
B) 

Main memory 
C) 

The CPU 
D) 

Secondary storage devices 
E) 

All of the above 

 
13) 

A characteristic of ________________ is that only an object's methods are able to directly access and make the changes to the object's data. 

13) 

______ 
A) 

Classes 

B) 

Procedures 
C) 

Data hiding 

D) 

Component reusability 

 
14) 

Because Java byte code is the same on all computers, compiled Java programs 

14) 

______ 
A) 

Are non-existent 
B) 

Must be re-compiled for each different machine it is run on 
C) 

Are highly portable 
D) 

Cannot run on Linux systems 

 
15) 

The two primary methods of programming in use today are 

15) 

______ 
A) 

Procedural 

B) 

Object oriented 
C) 

Both A and B 

D) 

Method and procedures 

 
16) 

This is a cross between human language and a programming language. 

16) 

______ 
A) 

The compiler 

B) 

The Java Virtual Machine 
C) 

Pseudocode 

D) 

Java 

 
17) 

Byte code instructions are 

17) 

______ 
A) 

Machine code instructions 

B) 

Syntax errors 
C) 

Read and interpreted by the JVM 

D) 

Another name for source code 

 
18) 

One of the design tools used by programmers when creating a model of the program is 

18) 

______ 
A) 

Pseudocode 

B) 

Compiler 

C) 

Disk drive 

D) 

ALU 

 
19) 

Key words are 

19) 

______ 
A) 

Symbols or words that perform operations on one or more operands 
B) 

Words that have a special meaning in the programming language 
C) 

The data names in your program 
D) 

Words or names defined by the programmer 

 
20) 

Computers can do many different jobs because they are ____. 

20) 

______ 
A) 

Electronic 

B) 

Programmable 

C) 

Software 

D) 

Hardware 

 
21) 

Java was developed by 

21) 

______ 
A) 

Sun Microsystems 

B) 

IBM 
C) 

Microsoft. 

D) 

Hewlett-Packard 

 
22) 

This is a software entity that contains data and procedures. 

22) 

______ 
A) 

Program 

B) 

Class 

C) 

Method 

D) 

Object 

 
23) 

The original name for Java was 

23) 

______ 
A) 

Elm 

B) 

Oak 

C) 

HotJava 

D) 

Java 

 
24) 

An operating system can be categorized according to: 

24) 

______ 
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 

 
25) 

Application software refers to 

25) 

______ 
A) 

The programs that make the computer useful to the user 
B) 

The operating system 
C) 

Key words 
D) 

Pseudocode 

 
26) 

Another term for programs is 

26) 

______ 
A) 

Software 

B) 

Hardware 

C) 

Firmware 

D) 

Peopleware 

 
27) 

These  are used to indicate the end of a Java statement. 

27) 

______ 
A) 

Periods 

B) 

Asterisks 

C) 

Colons 

D) 

Semicolons 

 
28) 

What is syntax? 

28) 

______ 
A) 

Rules that must be followed when writing a program. 
B) 

Words that have a special meaning in the programming language. 
C) 

Symbols or words that perform operations. 
D) 

Punctuation 

 
29) 

This is a set of programming language statements that, together, perform a specific task. 

29) 

______ 
A) 

Pseudocode 

B) 

Compiler 

C) 

Object 

D) 

Procedure 

 
30) 

A computer program is 

30) 

______ 
A) 

Pseudocode 
B) 

Main memory 
C) 

A flow chart 
D) 

A set of instructions that enable the computer to solve a problem or perform a task. 

 
31) 

In the Programming Process which of the following is not involved in defining what the program is to do 

31) 

______ 
A) 

Process 
B) 

Output 
C) 

Compile code 
D) 

Purpose 
E) 

Input 

 
32) 

Internally, the central processing unit (CPU) consists of two parts: 

32) 

______ 
A) 

The input and output devices 
B) 

The control unit and the arithmetic and logic unit (ALU) 
C) 

The control unit and main memory 
D) 

The arithmetic and login unit (ALU) and main memory 

 
33) 

A byte is a collection of 

33) 

______ 
A) 

Eight bits 

B) 

Four bits 

C) 

Six bits 

D) 

A dollar 

 
34) 

A runtime error is usually the result of 

34) 

______ 
A) 

A logical error 

B) 

A compilation error 
C) 

A syntax error 

D) 

Bad data 

 
35) 

This is a special language used to write computer programs. 

35) 

______ 
A) 

Application 

B) 

Programming language 
C) 

Pseudocode 

D) 

Operating system 

 
36) 

The data contained in an object is known as___. 

36) 

______ 
A) 

Atriums 

B) 

Classes 

C) 

Methods 

D) 

Attributes 

 
37) 

Which of the following commands will compile a program named ReadIt? 

37) 

______ 
A) 

java ReadIt.javac 

B) 

javac ReadIt.javac 
C) 

javac ReadIt.java 

D) 

java ReadIt.java 

 
TRUE/FALSE.  Write 'T' if the statement is true and 'F' if the statement is false. 
38) 

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

38) 

______ 

 
39) 

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

39) 

______ 

 
40) 

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

40) 

______ 

 
41) 

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

41) 

______ 

 
42) 

Compiled byte code is also called source code 

42) 

______ 

 
43) 

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

43) 

______ 

 
44) 

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

44) 

______ 

 
45) 

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

45) 

______ 

 
46) 

Java source files end with the .class extension. 

46) 

______ 

 
47) 

A procedure is a set of programming language statements that, together, perform a specific task. 

47) 

______ 

 
48) 

Most commercial software applications are large and complex and are usually developed by a single individual. 

48) 

______ 

 
49) 

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

49) 

______ 

 
50) 

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. 

50) 

______ 

 
1) 

A 

2) 

C 

3) 

B 

4) 

C 

5) 

A 

6) 

B 

7) 

B 

8) 

A 

9) 

C 

10) 

D 

11) 

D 

12) 

E 

13) 

C 

14) 

C 

15) 

C 

16) 

C 

17) 

C 

18) 

A 

19) 

B 

20) 

B 

21) 

A 

22) 

D 

23) 

B 

24) 

C 

25) 

A 

26) 

A 

27) 

D 

28) 

A 

29) 

D 

30) 

D 

31) 

C 

32) 

B 

33) 

A 

34) 

A 

35) 

B 

36) 

D 

37) 

C 

38) 

TRUE 

39) 

TRUE 

40) 

FALSE 

41) 

TRUE 

42) 

FALSE 

43) 

TRUE 

44) 

TRUE 

45) 

TRUE 

46) 

FALSE 

47) 

TRUE 

48) 

FALSE 

49) 

FALSE 

50) 

TRUE