Exam 4: Decision Structures
Exam 1: Introduction to Computers and Java40 Questions
Exam 2: Java Fundamentals40 Questions
Exam 3: A First Look at Classes and Objects40 Questions
Exam 4: Decision Structures42 Questions
Exam 5: Loops and Files40 Questions
Exam 6: A Second Look at Classes and Objects40 Questions
Exam 7: Arrays and the Arraylist Class40 Questions
Exam 8: Text Processing and Wrapper Classes40 Questions
Exam 9: Inheritance40 Questions
Exam 10: Exceptions and Advanced File Io40 Questions
Exam 11: Java-Fx: Gui Programming and Basic Controls40 Questions
Exam 12: Java-Fx: Advanced Controls40 Questions
Exam 13: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 14: Recursion24 Questions
Exam 15: Databases40 Questions
Select questions type
Which of the following strings could be passed to the DecimalFormat constructor to display 12.78 as 12.8?
(Multiple Choice)
4.8/5
(33)
What will be the value of ans after the following statements are executed?
int x = 40;
Int y = 40;
If (x = y)
Ans = x + 10;
(Multiple Choice)
4.9/5
(47)
The DecimalFormat class is part of the Java API so it is automatically available to your programs.
(True/False)
4.9/5
(37)
Which of the following statements will create an object from the Random class?
(Multiple Choice)
4.9/5
(41)
Select all that apply. Which method of the Random class will return a random number within the range of 0.0 and 1.0?
(Multiple Choice)
4.9/5
(37)
The __________ statement is used to create a decision structure which allows a program to have more than one path of execution.
(Multiple Choice)
4.9/5
(44)
Which of the following statements determines whether the variable temp is within the range of 0 through 100 (inclusive)?
(Multiple Choice)
4.8/5
(36)
A __________ is a boolean variable that signals when some condition exists in the program.
(Multiple Choice)
4.8/5
(43)
A random number, created as an object of the Random class, is always an integer.
(True/False)
4.8/5
(39)
Which of the following expressions will determine whether x is less than or equal to y?
(Multiple Choice)
4.7/5
(37)
Java requires that the boolean expression being tested by an if statement be enclosed in
(Multiple Choice)
4.7/5
(31)
All it takes for an AND expression to be true is for one of the subexpressions to be true.
(True/False)
4.8/5
(38)
Which of the following expressions will generate a random number in the range of 1 through 10?
(Multiple Choice)
4.9/5
(38)
If the expression on the left side of the && operator is false, the expression on the right side will not be checked.
(True/False)
4.9/5
(35)
Which of the following expressions determines whether the char variable, chrA, is not equal to the letter 'A'?
(Multiple Choice)
4.7/5
(27)
In a switch statement, if two different values for the CaseExpression would result in the same code being executed, you must have two copies of the code, one after each CaseExpression.
(True/False)
4.9/5
(39)
What will be the value of discountRate after the following statements are executed?
double discountRate;
Char custType = 'B';
Switch (custType)
{
Case 'A':
DiscountRate = 0.08;
Break;
Case 'B':
DiscountRate = 0.06;
Case 'C':
DiscountRate = 0.04;
Default:
DiscountRate = 0.0;
}
(Multiple Choice)
4.9/5
(41)
When testing for character values, the switch statement does not test for the case of the character.
(True/False)
4.9/5
(39)
What will be displayed after the following statements are executed?
int hours = 30;
Double pay, payRate = 10.00;
Pay = hours <= 40 ? hours*payRate : hours*payRate*2.0;
System.out.println(pay);
(Multiple Choice)
4.8/5
(45)
Showing 21 - 40 of 42
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)