gaddis java 5 chapter 01 quiz

Download Gaddis Java 5 Chapter 01 Quiz

If you can't read please download the document

Upload: jonathan-bigelow

Post on 06-Sep-2014

904 views

Category:

Documents


8 download

TRANSCRIPT

Gaddis Starting Out With Java 5 From Control Structures to Objects Chapter 01 Introduction to Computers and Java Multiple Choice 1. Another term for programs is a. Hardware b. Software c. Firmware d. Peopleware ANS: B 2. 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 3. A byte is a collection of a. Four bits b. Six bits c. Eight bits d. A dollar ANS: C 4. ____ is a multitasking operating system. a. Windows b. Unix c. Both of the above d. Neither of the above ANS: C 5. Application software refers to programs that make the computer useful to the user. a. True b. False ANS: A 6. A(n) _____ is a special language used to write computer programs. a. Programming language b. Operating system

c. d.

Application Pseudocode

ANS: A 7. The original name for Java was a. Java b. HotJava c. Elm d. Oak ANS: D 8. 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 9. Variables are a. Symbolic names made up by the programmer that represents locations in the computers 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 10. Colons are used to indicate the end of a Java statement. a. True b. False ANS: B ANS: 11. 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

12. Before using the javac command to compile a Java program, 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 the Java program you want to compile is located d. Close all other Windows on your computer system ANS: C 13. 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 14. 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 15. A procedure is a set of programming language statements that, together, perform a specific task. a. True b. False ANS: A 16. 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 17. 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 if the program solves the original problem

ANS: D 18. A software entity that contains data and procedures is a(n)_____. a. Method b. Object c. Class d. Program ANS: B 19. _____ results.in only the objects methods being able to directly access and make the changes to the objects data. a. Component reusability b. Classes c. Data hiding d. Procedures ANS: C 20. When an objects internal data is hidden from outside code and access to that data is restricted to the objects methods, the data is protected from accidental corruption. a. True b. False ANS: A 21. A. a. b. c. d. _____ is a software object that performs a specific task. Component Class Procedure CPU

ANS: C 22. Each method manipulates one or more a. Attributes b. Other methods c. Classes d. Objects ANS: A 23. The two primary methods of programming in use today are a. Procedural

b. c. d.

Object oriented Both (a) and (b) Method and procedures

ANS: C 24. An object typically hides it's 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 ANS: A 25. Most commercial software applications are large and complex and are usually developed by a single individual. a. True b. False ANS: B 26. Computers can do many different jobs because they are ____. a. Electronic b. Programmable c. Hardware d. Software ANS: B 27. Software refers to a. The physical components that a computer is made of. b. Firmware c. Programs d. Peopleware ANS: C 28. 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 logic unit ALU and main memory d. The input and output devices ANS: A 29. RAM is usually

a. b. c. d.

A static type of memory, used for permanent storage A volatile type of memory, used only for temporary storage Secondary storage An input/output device

ANS: B 30. Each byte is assigned a unique number known as an address. a. True b. False ANS: A 31. 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 32. 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 33. Java was developed by a. Microsoft. b. IBM c. Sun d. Hewlett-Packard ANS: C 34. 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 35. ____ are used to indicate the end of a Java statement.

a. b. c. d.

Semicolons Colons Periods Asterisks

ANS: A 36. The Java Virtual Machine is a program that reads Java byte code instructions and executes them as they are read. a. True b. False ANS: A 37. 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 38. 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 ANS: C 39. 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 40. 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 ANS: D

41. ____ is a cross between human language and a programming language. a. Pseudocode b. Java c. The Java Virtual Machine d. The compiler ANS: A 42. Logical errors are mistakes that cause the program to produce erroneous results. a. True b. False ANS: A 43. A(n) ____ is a set of programming language statements that, together, perform a specific task. a. Object b. Compiler c. Procedure d. Pseudocode ANS: C 44. The data contained in an object is known as___. a. Methods b. Attributes c. Classes d. Atriums ANS: B 45. Encapsulation refers to the combining of data and code into a single object. a. True b. False ANS: A 46. 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 ANS: A 47. The two primary methods of programming in use today are

a. b. c. d.

Procedural Object oriented Both a and b Methods and procedures

ANS: C 48. 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 ANS: C 49. OOP addresses the problem of code/data separation through a. Data hiding b. Encapsulation c. Neither a.or b d. Both a and b ANS: D