Exam 2: Using Data
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
Describe how to use the boolean data type. Show two examples of a boolean variable assignment; one that uses true or false and one that uses a relational operator.
Free
(Essay)
5.0/5
(40)
Correct Answer:
Boolean logic is based on true or false comparisons. Whereas an int variable can hold millions of different values (at different times), a boolean variable can hold only one of two values-true or false. Besides assigning true and false, you also can assign a value to a Boolean variable based on the result of a comparison.
boolean isItPayday = false; boolean isItPayday = (today="Friday");
Match each term with the correct statement below.
Premises:
Rules for the order in which parts of a mathematical expression are evaluated
Responses:
operand.
operator precedence.
primitive type.
Correct Answer:
Premises:
Responses:
Free
(Matching)
4.9/5
(34)
Correct Answer:
Describe how the Scanner class works with the System.in object in order to provide flexibility. Provide an example of using the Scanner class with System.in.
Free
(Essay)
4.7/5
(41)
Correct Answer:
The System.in object is designed to read bytes only. Since it is common to accept data of other types, the Scanner object can connect to the System.in property. This creates a Scanner object that will be connected to the default input device.
Scanner inputDevice = new Scanner(System.in);
A variable declaration is a statement that reserves a named memory location. It includes what four elements?
(Essay)
4.9/5
(40)
Match each term with the correct statement below.
Premises:
A floating-point data type
Responses:
blank final
float.
lvalue
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(34)
Which escape sequence will move the cursor to the beginning of the current line?
(Multiple Choice)
4.9/5
(39)
You may declare an unlimited number of variables in a statement as long as the variables are ____.
(Multiple Choice)
4.7/5
(32)
What is the difference between the float data type and the double data type?
(Essay)
4.9/5
(54)
Match each term with the correct statement below.
Premises:
true or false
Responses:
float.
boolean
operator precedence.
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(38)
Describe three ways in which a named constant differs from a variable.
(Essay)
4.7/5
(39)
Match each term with the correct statement below.
Premises:
Break into component parts
Responses:
lvalue
parse
assignment.
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(47)
The expression boolean isTenLarger = (10 < 5) will produce a value of true .
(True/False)
4.8/5
(41)
Match each term with the correct statement below.
Premises:
Also called the type-ahead buffer
Responses:
cast operator.
promotion
boolean
Correct Answer:
Premises:
Responses:
(Matching)
4.7/5
(31)
The ____ is the type to which all operands in an expression are converted so that they are compatible with each other.
(Multiple Choice)
4.9/5
(43)
import javax.swing.JOptionPane;
public class salesJune
{
public static void main(String[] args)
{
int storeSales = 250;
}
}
In the above code, complete the statement that will display a message dialog box that will appear centered on the screen and will display the following text:
Congratulations! June sales were $250!
(Essay)
4.8/5
(28)
Match each term with the correct statement below.
Premises:
Can appear on the left side of an assignment operator
Responses:
garbage value.
assignment.
boolean
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(28)
In Java, when a numeric variable is concatenated to a String using the ____, the entire expression becomes a String .
(Multiple Choice)
4.9/5
(28)
Showing 1 - 20 of 81
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)