Deck 1: Introduction
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
Play
Full screen (f)
Deck 1: Introduction
1
In Java, total, ToTal and TOTAL are all different identifiers.
True
Explanation: Java is case-sensitive, so these three identifiers are all different.
Explanation: Java is case-sensitive, so these three identifiers are all different.
2
Which of the following is not one of the four basic software development activities?
A) establishing the requirements
B) creating a design
C) preliminary practice coding
D) testing
E) implementing the design
A) establishing the requirements
B) creating a design
C) preliminary practice coding
D) testing
E) implementing the design
C
Explanation: Preliminary practice coding is not one of the four basic software development activities. Establishing the requirements for a program, creating a design for a program, implementing the design and testing the program all occur during software development.
Explanation: Preliminary practice coding is not one of the four basic software development activities. Establishing the requirements for a program, creating a design for a program, implementing the design and testing the program all occur during software development.
3
In Java, an identifier that is made up by the programmer can consist of ___________________.
A) any characters
B) only numbers
C) only letters
D) only letters, the underscore ( _ ), and the dollar sign ( $ )
E) numbers, letters, the underscore ( _ ), and the dollar sign ( $ )
A) any characters
B) only numbers
C) only letters
D) only letters, the underscore ( _ ), and the dollar sign ( $ )
E) numbers, letters, the underscore ( _ ), and the dollar sign ( $ )
E
Explanation: In Java, an identifier can consist of numbers, letters, the underscore and the dollar sign, but it cannot begin with a number.
Explanation: In Java, an identifier can consist of numbers, letters, the underscore and the dollar sign, but it cannot begin with a number.
4
Which of the following will is considered a logical error?
A) forgetting a semicolon at the end of a programming statement
B) typing a curly bracket when you should have typed a parenthesis
C) multiplying two numbers when you meant to add them
D) dividing by zero
E) misspelling an identifier
A) forgetting a semicolon at the end of a programming statement
B) typing a curly bracket when you should have typed a parenthesis
C) multiplying two numbers when you meant to add them
D) dividing by zero
E) misspelling an identifier
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
5
Java is _____________________.
A) a procedural language
B) a functional language
C) an object-oriented language
D) a fourth-generation language
E) a spoken-language
A) a procedural language
B) a functional language
C) an object-oriented language
D) a fourth-generation language
E) a spoken-language
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
6
Comments affect the run-time execution of a program.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
7
Software requirements specify ____________________.
A) what a program should accomplish
B) which programming language the developer should use
C) how objects should be encapsulated
D) how a solution should be implemented
E) a programming schedule
A) what a program should accomplish
B) which programming language the developer should use
C) how objects should be encapsulated
D) how a solution should be implemented
E) a programming schedule
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
8
Classes can be created from other classes by using _______________ .
A) encapsulation
B) polymorphism
C) inheritance
D) attributes
E) machine code
A) encapsulation
B) polymorphism
C) inheritance
D) attributes
E) machine code
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
9
The Java compiler translates Java source code into _____________ .
A) Java bytecode
B) C++
C) assembly code
D) machine code
E) an object-oriented language
A) Java bytecode
B) C++
C) assembly code
D) machine code
E) an object-oriented language
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
10
An identifier can begin with a digit.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following lines is a properly formatted comment?
A) // This is a comment
B) /* This is a comment */
C) /* this is a comment
*/
D) both a and b
E) a, b and c
A) // This is a comment
B) /* This is a comment */
C) /* this is a comment
*/
D) both a and b
E) a, b and c
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
_____________ consists of specific words and symbols to express a problem solution.
A) A programming language
B) Software
C) Hardware
D) A computer
E) An application
A) A programming language
B) Software
C) Hardware
D) A computer
E) An application
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
Java is case-sensitive.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
14
Which of the following might be included in an IDE?
A) a compiler
B) an editor
C) a debugger
D) all of the above
E) none of the above
A) a compiler
B) an editor
C) a debugger
D) all of the above
E) none of the above
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
Which of the following describes the act of ensuring that a program solves the intended problem in all cases?
A) establishing the requirements
B) testing
C) preliminary practice coding
D) implementing the design
E) creating a design
A) establishing the requirements
B) testing
C) preliminary practice coding
D) implementing the design
E) creating a design
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
16
Which of the following is not a valid Java identifier?
A) answer_7
B) highest$
C) anExtremelyLongIdentifierIfYouAskMe
D) 2ndlevel
E) thirdNumber
A) answer_7
B) highest$
C) anExtremelyLongIdentifierIfYouAskMe
D) 2ndlevel
E) thirdNumber
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
17
The _____________ of an object define it define its potential behaviors.
A) attributes
B) white spaces
C) variables
D) methods
E) name
A) attributes
B) white spaces
C) variables
D) methods
E) name
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
In order for a program to run on a computer, it must be expressed in ______________________.
A) an assembly language
B) a machine language
C) a high-level language
D) an object-oriented language
E) a fourth generation language
A) an assembly language
B) a machine language
C) a high-level language
D) an object-oriented language
E) a fourth generation language
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
19
A reserved word can be used to name a method.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
20
A syntax error is a _____________________.
A) a logical error
B) a compile-time error
C) a run-time error
D) a bug
E) an exception
A) a logical error
B) a compile-time error
C) a run-time error
D) a bug
E) an exception
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
21
Write an application that prints the first few lines of a song (your choice).
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
22
Give three examples of Java reserved words.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
23
Explain the difference between a compile-time error and a run-time error. Give an example of each.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
24
Write a short Java program that outputs your name, your major, and your birthday on three different lines.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
25
These two snippets of code are identical from the point of view of the compiler:
//snippet 1
public static void main(String [] args) {
System.out.println("Hi!");
}
//snippet 2
public static void main(String [] args){System.out.println("Hi!");}
//snippet 1
public static void main(String [] args) {
System.out.println("Hi!");
}
//snippet 2
public static void main(String [] args){System.out.println("Hi!");}
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
26
An interpreter is a program that translates code that is written in one language into equivalent code in another language.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
27
What are the primary concepts that support object-oriented programming?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
28
Write a short application that prints out a list of classes that you are currently taking.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
29
Determine a good identifier for each of the following entities in a program that calculates the final grade:
a) A grade on the first test of the semester
b) The total number of tests
c) The total number of homework assignments
d) The relative weight of the tests
a) A grade on the first test of the semester
b) The total number of tests
c) The total number of homework assignments
d) The relative weight of the tests
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
30
Why is ambiguity a problem for programming languages?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
31
Identify the syntax errors in the following snippet of code:
public clas Hello {
public static void main(String [] args) {
Sytem.out.println("Hello Wrld!")
}
}
public clas Hello {
public static void main(String [] args) {
Sytem.out.println("Hello Wrld!")
}
}
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
32
Name the steps to solving a problem as described by your textbook.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
33
What are some advantages to writing programs in a high-level language instead of machine code?
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
34
An object should never be encapsulated.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
35
Identifiers can be of any length.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
36
Write a program that outputs Four Score and Seven Years Ago on six lines, with the words centered relative to each other.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
37
Name the four basic activities that are involved in a software development process.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
38
Explain the difference between the syntax of a program and the semantics of a program.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
39
Write a short Java program that outputs the following:
*
*
*
************** Time flies like an arrow
*
*
*
*
*
*
************** Time flies like an arrow
*
*
*
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
40
Syntax rules dictate the form of a program. Semantics dictate the meaning of the program statements.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck