Exam 3: Decision Structures
Exam 1: Introduction to Computers and Java53 Questions
Exam 2: Java Fundamentals52 Questions
Exam 3: Decision Structures58 Questions
Exam 4: Loops and Files56 Questions
Exam 5: Methods56 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class63 Questions
Exam 8: A Second Look at Classes and Objects52 Questions
Exam 9: Text Processing and More About Wrapper Classes62 Questions
Exam 10: Inheritance64 Questions
Exam 11: Exceptions and Advanced File Io59 Questions
Exam 12: Java-Fx: Gui Programming and Basic Controls42 Questions
Exam 13: Java-Fx: Advanced Controls40 Questions
Exam 14: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 15: Recursion23 Questions
Exam 16: Databases40 Questions
Select questions type
If you prematurely terminate an if statement with a semicolon, the compiler will
(Multiple Choice)
4.8/5
(28)
In Java, when a character is stored in memory, it is actually the __________ that is stored.
(Multiple Choice)
4.8/5
(28)
What will be the value of discountRate after the following statements are executed?
double discountRate = 0.0;
Int purchase = 1250;
Char cust = 'N';
If (purchase > 1000)
If (cust == 'Y')
DiscountRate = 0.05;
Else
DiscountRate = 0.04;
Else if (purchase > 750)
If (cust == 'Y')
DiscountRate = 0.04;
Else
DiscountRate = 0.03;
Else
DiscountRate = 0.0;
(Multiple Choice)
4.8/5
(34)
__________ operators are used to determine whether a specific relationship exists between two values.
(Multiple Choice)
5.0/5
(40)
What will be the value of discountRate after the following statements are executed?
double discountRate = 0.0;
Int purchase = 100;
If (purchase > 1000)
DiscountRate = 0.05;
Else if (purchase > 750)
DiscountRate = 0.03;
Else if (purchase > 500)
DiscountRate = 0.01;
(Multiple Choice)
4.8/5
(29)
What is the value of ans, x, and y after the following statements are executed?
int ans = 0, x = 15, y = 25;
If ( x >= y)
{
Ans = x + 10;
X -=y;
}
Else
{
Ans = y + 10;
Y += x;
}
(Multiple Choice)
4.8/5
(39)
Which of the following expressions will determine whether x is less than or equal to y?
(Multiple Choice)
4.8/5
(32)
Which of the following will format 12.7801 to display as $12.78?
(Multiple Choice)
4.7/5
(34)
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.8/5
(43)
What would be the value of discountRate after the following statements are executed?
double discountRate = 0.0;
Int purchase = 1250;
If (purchase > 1000)
DiscountRate = .05;
If (purchase > 750)
DiscountRate = .03;
If (purchase > 500)
DiscountRate = .01;
Else
DiscountRate = 0;
(Multiple Choice)
4.8/5
(33)
What will be displayed after the following statements are executed?
int y = 10;
If (y == 10)
{
Int x = 30;
X += y;
System.out.println(x);
}
(Multiple Choice)
4.9/5
(41)
What will be the value of x after the following statements are executed?
int x = 75;
Int y = 60;
If (x > y)
X = x - y;
(Multiple Choice)
4.8/5
(32)
What is the value of x after the following code has been executed?
int x = 75;
Int y = 90;
If (x != y)
X += y;
(Multiple Choice)
4.8/5
(35)
What is the value of charges after the following code has been executed?
double charges, rate = 7.00;
Int time = 180;
Charges = time <= 119 ? rate * 2 :
Time / 60.0 * rate;
(Multiple Choice)
4.7/5
(39)
Java requires that the boolean expression being tested by an if statement be enclosed in
(Multiple Choice)
4.9/5
(37)
Showing 21 - 40 of 58
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)