1 - Department of Computer Science



Chapter 1

Introduction to Computers and Java

( Test 2

1. Computers can do many different jobs because they are ____.

(a) Electronic

(b) Programmable

(c) Hardware

(d) Software

Answer: B, Why Program?

2. Software refers to

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

(b) Firmware

(c) Programs

(d) Peopleware

Answer: C, Computer Systems: Hardware And Software

3. 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

Answer: A, Computer Systems: Hardware And Software

4. 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

Answer: B, Computer Systems: Hardware And Software

5. True/False Each byte is assigned a unique number known as an address.

Answer: True, Computer Systems: Hardware And Software

6. Application software refers to

(a) The operating system

(b) Pseudocode

(c) Key words

(d) The programs that make the computer useful to the user

Answer: D, Computer Systems: Hardware And Software

7. 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

Answer: A, Programming Languages

8. Java was developed by

(a) Microsoft.

(b) IBM

(c) Sun

(d) Hewlett-Packard

Answer: C, Programming Languages

9. 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

Answer: B, What is a Program Made Of?

10. ____ are used to indicate the end of a Java statement.

(a) Semicolons

(b) Colons

(c) Periods

(d) Asterisks

Answer: A, What is a Program Made Of?

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

Answer: True, What is a Program Made Of?

12. 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

Answer: D, What is a Program Made Of?

13. Which of the following will compile a program called ReadIt?

(a) java-source 1.5 ReadIt.java

(b) java ReadIt.javac

(c) javac ReadIt.java

(d) javac-source 1.5ReadIt.javac

Answer: C, What is a Program Made Of?

14. Which of the following will run the compiled program ReadIt?

(a) java ReadIt.java

(b) java ReadIt

(c) run ReadIt

(d) go ReadIt

Answer: B, What is a Program Made Of?

15. Which of the following is not part of the programming process

(a) Design/model

(b) Testing

(c) Debugging/correcting errors

(d) All the above are parts of the programming process

Answer: D, The Programming Process

16. ____ is a cross between human language and a programming language.

(a) Pseudocode

(b) Java

(c) The Java Virtual Machine

(d) The compiler

Answer: A, The Programming Process

17. True/False Logical errors are mistakes that cause the program to produce erroneous results.

Answer: True, The Programming Process

18. A(n) ____ is a set of programming language statements that, together, perform a specific task.

(a) Object

(b) Compiler

(c) Procedure

(d) Pseudocode

Answer: C, Object-Oriented Programming

19. The data contained in an object is known as___.

(a) Methods

(b) Attributes

(c) Classes

(d) Atriums

Answer: B, Object-Oriented Programming

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

Answer: True, Object-Oriented Programming

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

(a) The methods that operate on the data

(b) The data files

(c) Private data members

(d) The pseudocode

Answer: A, Object-Oriented Programming

22. The two primary methods of programming in use today are

(a) Procedural

(b) Object oriented

(c) Both (a) and (b)

(d) Method and procedures

Answer: C, Object-Oriented Programming

23. Whereas ___ is centered on creating procedures, _____ is centered on creating objects.

(a) Procedural programming, Class programming

(b) Object-oriented programming, Procedural programming

(c) Procedural programming, Object-oriented programming

(d) Routine programming, method programming

Answer: C, Object-Oriented Programming

24. OOP addresses the problem of code/data separation through

(a) Data hiding

(b) Encapsulation

(c) Neither (a) or (b)

(d) Both (a) and (b)

Answer: D, Object-Oriented Programming

25. 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.

Answer: True, Object-Oriented Programming

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download