Assignment 1 Questions
Which of the following is not part of the programming process? A. defining and modeling the problem B. testing and debugging C. entering code and compiling it D. All of these are parts of the programming process.
All the above
(T/F) Colons are used to indicate the end of a Java statement.
False
(T/F) Compiled byte code is also called source code
False
The original name for Java was A. HotJava. B. JavaScript. C. Oak. D. *7.
Oak
A runtime error is usually the result of A. a syntax error. B. a logical error. C. a compiler error. D. bad data.
a logical error
The end of a Java statement is indicated by a A. semicolon (;) B. colon (:) C. asterisk (*) D. bracket (})
semicolon ()
Variables are A. reserved words. B. symbolic names made up by the programmer and once created, their values cannot be changed. C. symbolic names made up by the programmer that represent memory locations. D. operators that perform operations on one or more operands.
symbolic names made up by the programmer that represent memory locations.
The data contained in an object is known as A. the fields. B. the methods. C. the attributes. D. the classes.
the attributes
A computer program is A. only used for desktop computers. B. a set of instructions that allow the computer to solve a problem or perform a task. C. another name for an operating system. D. the same as main memory.
a set of instructions that allow the computer to solve a problem or perform a task.
RAM is usually A. a static type of memory, used for permanent storage. B. a volatile type of memory, used for temporary storage. C. an input/output device. D. secondary storage.
a volatile type of memory, used for temporary storage.
Because Java byte code is the same on all computers, compiled Java programs A. cannot run on computers with different operating systems. B. are highly portable. C. are nonexistent. D. must be re-compiled for each different machine before they can be run.
are highly portable
A characteristic of ________ is that only an object's methods are able to directly access and make changes to an object's data. A. component reusability B. classes C. data hiding D. procedures
data hiding
(T/F) Java source files end with the .class extension.
false
Which of the following commands will run the compiled Java program named DoItNo? A. java DoItNow B. run DoItNow C. go DoItNow D. java DoItNow.java
java DoitNow
Validating the results of a program is important to A. create a model of the program. B. correct runtime errors. C. make sure the program solves the original problem. D. correct syntax error.
make sure the program solves the original problem
Assume you are at the operating system command line and want 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. close all open windows on your computer system. C. execute the java.sun.com program. D. make sure you are in the same directory or folder where the MyClass.java file is located.
make sure you are in the same directory or folder where the MyClass.java file is located.
A(n) ________ is a software entity that contains data and procedures. Select one: A. method B. class C. object D. program
object
The two primary methods of programming in use today are A. hardware and software. B. desktop and mobile. C. practical and theoretical. D. procedural and object-oriented.
procedural and object-oriented.
While____is centered on creating procedures,____is centered on creating objects A. object-oriented programming, procedural programming B. procedural programming, object-oriented programming C. routine programming, method programming D. procedural programming, class programming
procedural programming, object-oriented programming
A set of programming language statements that perform a specific task is a(n) A. object. B. procedure. C. pseudocode chart. D. source code.
procedure
Computers can do many different jobs because they are A. programmable. B. electronic. C. reliable. D. automated.
programmable
A(n) ________ is used to write computer programs. A. operating system B. pseudocode document C. application D. programming language
programming language
Software refers to A. programs. B. the physical components a computer is made of. C. data stored in RAM. D. firmware.
programs
A cross between human language and a programming language is called A. a compiler. B. the Java language. C. pseudocode. D. the Java Virtual Machine.
pseudocode
One type of design tool used by programmers when creating a model of a program is A. byte code. B. pseudocode. C. syntax. D. the ALU.
pseudocode
Byte code instructions are A. read and interpreted by the JVM. B. syntax errors. C. machine code instructions. D. another name for source code.
red and interpreted by the JVM
The central processing unit (CPU) consists of two parts which are A. the arithmetic and logic unit (ALU) and main memory. B. the control unit and main memory. C. the input and output devices. D. the control unit and the arithmetic and logic unit (ALU).
the control unit and the arithmetic and logic unit (ALU).
An object typically hides its data but allows outside code access to A. private data members. B. the data files. C. the pseudocode. D. the methods that operate on the data.
the methods that operate on the data.
Application software refers to A. the operating system. B. pseudocode. C. key words. D. the programs that make the computer useful to the user.
the programs that make the computer useful to the user.
What is syntax? A. the words that have a special meaning in the programming language B. the rules that must be followed when writing a program C. the symbols or words that perform operations in a program D. the words or characters that are defined by the programmer
the rules that must be followed when writing a program
Key words are A. words or characters representing values that are defined by the programmer. B. words that have a special meaning in the programming language. C. symbols or words that perform operations on one or more operands. D. the data names in your program.
words that have a special meaning in the programming language.
There are ________ bits in a byte. A. 8 B. 4 C. 16 D. 32
8
________ refers to the physical components that a computer is made of. A. Input B. Control unit C. Main memory D. Hardware
Hardware
(T/F) A procedure is a set of programming language statements that, together, perform a specific task.
True
(T/F) A solid-state drive has no moving parts and operates faster than a traditional disk drive.
True
(T/F) Each byte is assigned a unique number known as an address.
True
(T/F) Encapsulation refers to the combining of data and code into a single object.
True
(T/F) Logical errors are mistakes that cause the program to produce erroneous results.
True
(T/F) The Java Virtual Machine is a program that reads Java byte code instructions and executes them as they are read.
True