Module 4 Flashcards
Which of the following are true about arithmetic expressions?
A. Subtraction is always done after addition
B. 1 + 2 * 3 is equal to 7
C. Multiplication is always done before addition
D. 6 + 4 / 2 is equal to 5
E. 5 * 4 / 4 - 1 is equal to 6
B. 1 + 2 * 3 is equal to 7
C. Multiplication is always done before addition
What is a Java Virtual Machine (JVM)?
A. an editor specific to Java
B. a complier
C. a psuedo code generator
D. a language run-time environment
D. a language run-time environment
Given two variables x and y, which code below swaps the current values of x and y?
A. y = x ; x = y;
B. x = y; y = x;
C. t = x; x = y; y = t;
D. t = x; y = x; y = t;
C. t = x; x = y; y = t;
Which of the following are derived data types in the Java language?
A. double
B. char
C. []
D. indirection
E. String
C. []
E. String
Which of the following statements are true regarding an Interactive Development Environment (IDE)? (Check all that apply)
A. An IDE expedites the resolution of runtime problems
B. An IDE is a burden to programmers, but produces faster code
C. An IDE generates algorithms for the programmer
D. An IDE contains access to an editor and a complier so that the programmer can cycle through these steps iteratively and easily before proceeding outside to the runtime environment
A. An IDE expedites the resolution of runtime problems
Which of the following are valid Java variable names?
A. Year2011
B. OVER_THE_TOP
C. over_the_top
D. $MINIMUM
E. 2for_one_sale
A. Year2011
B. OVER_THE_TOP
C. over_the_top
D. $MINIMUM
Which of the following statements are true regarding interpreters?
A. They use a three step approach of edit, compile, and run
B. They recompile each statement every time the program runs
C. They use a two step approach that combines the compile and run steps into one step
D. The source code file and the executable file are the same
E. Once a program runs perfectly, interpreters are faster than non-interpretive language programs
B. They recompile each statement every time the program runs
C. They use a two step approach that combines the compile and run steps into one step
D. The source code file and the executable file are the same
Which of the following are true about Java assignment statements?
A. In a Java assignment statement there can be multiple variables and constants on the left of the assignment operator
B. Java assignment statements use the = operator
C. Java assignment statements can have an arithmetic expression on the right of the assignment operator
D. A Java assignment statement is the same as an algebraic equality statement
B. Java assignment statements use the = operator
C. Java assignment statements can have an arithmetic expression on the right of the assignment operator
Which of the following statements are true regarding the following Java statement? average = (x + y)/2.0
A. This statement contains two variables
B. This statement is an assignment statement
C. If the values of all variables in this statement was always guaranteed to be a round number, all variables would best be defined as integer
D. This statement is an algebraic equality statement
B. This statement is an assignment statement
What is a void method in Java?
A. One that requires no inputs
B. One that is called “main”
C. One that requires no static memory
D. One that returns no data
D. One that returns no data
What does a Java compiler generate?
A. source code
B. object code
C. byte code
D. psuedo code
E. machine language
C. byte code
Which of the following are valid Java declarations and initializations of variables?
A. boolean true = yes;
B. constant PI = 3.1416;
C. int x = 1000000;
D. char n = “Hello”;
E. short x = 4.26;
C. int x = 1000000;
If c equals negative two, what does an equal in the following Java statement?
a = 2 + c++
A. 6
B. 1
C. -2
D. 0
E. 2
D. 0
Which of the following statements are true about Java?
A. Java does not support objects
B. The Java compiler generates machine code
C. A Java program runs on a Java Virtual Machine
D. Java was developed for embedded applications
E. Java was developed at IBM
C. A Java program runs on a Java Virtual Machine
D. Java was developed for embedded applications
Which of the following Java statements correctly declares a constant?
A. double mORTGAGE_RATE = 3.5;
B. final double MRATE = 3.5;
C. constant mORTGAGE_RATE = 3.5;
D. constant MRATE = 3.5;
B. final double MRATE = 3.5;
Which of the following are true about a software program?
A. A program consists of instructions that accomplish a specific operation
B. A program consists of instructions that can be executed in any order
C. A program is responsible for validating user inputs
D. A set of program instructions is known as an algorithm
E. A program consists of instructions that must be executed in a specific sequence
A. A program consists of instructions that accomplish a specific operation
C. A program is responsible for validating user inputs
D. A set of program instructions is known as an algorithm
E. A program consists of instructions that must be executed in a specific sequence
Please select all of the following statements which apply to the Eclipse Integrated Development Environment (IDE).
A. Eclipse IDE facilitates the development of Java programs
B. Eclipse should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE
C. Eclipse is one of the many IDEs which may be installed to use the Java language software
D. Eclipse must be used to develop and run Java programs
E. Eclipse replaces the Java Virtual Machine
A. Eclipse IDE facilitates the development of Java programs
B. Eclipse should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE
C. Eclipse is one of the many IDEs which may be installed to use the Java language software
Which of the following are primitive Java data types?
A. int
B. double
C. String
D. Array
E. integer
A. int
B. double
Which of the following is a valid method header for the “main” method required in each Java application?
A. private static void main (String [] args)
B. public void main (Strings [] args)
C. public static int main (String [] args)
D. public static void main (String [] args)
E. public static void main (String args)
D. public static void main (String [] args)
Which of the following are true regarding the general description of keywords in a computer language?
A. Keywords in a language must be recognizable words in a written language
B. A particular keyword is used only in particular ways in a language
C. The meaning of a keyword is determined by the context in which it is used in a program
D. A particular keyword has one or more specialized meanings in the language
E. A particular keyword has the same meaning as its equivalent English word
B. A particular keyword is used only in particular ways in a language
C. The meaning of a keyword is determined by the context in which it is used in a program
D. A particular keyword has one or more specialized meanings in the language
Which of the following are true regarding Java syntax?
A. Curly braces, {}, always exist in pairs
B. indentation is important to Java
C. a comment starts with \
D. blank lines are ok
E. a single java statement cannot occupy more than one line
A. Curly braces, {}, always exist in pairs
D. blank lines are ok
In Java, what does the statement c+=a mean?
A. c + c = a
B. c = c + a
C. c = a + 1
D. c + c = a
E. c + 1 = a
B. c = c + a
Which of the following languages is interpretive?
A. Java
B. BASIC
C. jGRASP
D. C++
B. BASIC
Which of the following are characteristics of an algorithm?
A. The steps of an algorithm must be performed in a particular order
B. A computer program constitutes an algorithm
C. Algorithms can assume certain input
D. An algorithm is a sequence of instructions
E. Creating an algorithm is usually a trivial task
A. The steps of an algorithm must be performed in a particular order
B. A computer program constitutes an algorithm
D. An algorithm is a sequence of instructions