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
What will be printed when the following code is executed?
double x = 45678.259;
System.out.printf("%,.2f", x);
(Multiple Choice)
4.9/5
(35)
Which of the following expressions could be used to perform a case-insensitive comparison of two String objects named str1 and str2?
(Multiple Choice)
4.7/5
(41)
The if-else statement will execute one group of statements if its boolean expression is true or another group if its boolean expression is false.
(True/False)
4.8/5
(38)
Which of the following expressions determines whether the char variable, chrA, is not equal to the letter 'A'?
(Multiple Choice)
4.9/5
(32)
What will be displayed after the following statements are executed?
int ans = 10;
Int x = 65;
Int y = 55;
If (x >= y)
{
Int ans = x + y;
}
System.out.println(ans);
(Multiple Choice)
4.9/5
(46)
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
(31)
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
(30)
What would be the value of bonus after the following statements are executed? int bonus, sales = 85000;
Char dept = 'S';
If (sales > 100000)
If (dept == 'R')
Bonus = 2000;
Else
Bonus = 1500;
Else if (sales > 75000)
If (dept == 'R')
Bonus = 1250;
Else
Bonus = 1000;
Else
Bonus = 0;
(Multiple Choice)
4.9/5
(35)
When two strings are compared using the String class's compareTo method, the comparison is not case sensitive.
(True/False)
4.8/5
(35)
What will be the values of ans, x, and y after the following statements are executed?
int ans = 35, x = 50, y = 50;
If (x >= y)
{
Ans = x + 10;
X -= y;
}
Else
{
Ans = y + 10;
Y += x;
}
(Multiple Choice)
4.8/5
(42)
What will be the value of bonus after the following statements are executed? int bonus, sales = 10000;
If (sales < 5000)
Bonus = 200;
Else if (sales < 7500)
Bonus = 500;
Else if (sales < 10000)
Bonus = 750;
Else if (sales < 20000)
Bonus = 1000;
Else
Bonus = 1250;
(Multiple Choice)
4.8/5
(40)
What will be the value of x after the following statements are executed?
int x = 10;
Switch (x)
{
Case 10:
X += 15;
Case 12:
X -= 5;
Break;
Default:
X *= 3;
}
(Multiple Choice)
4.8/5
(46)
All it takes for an AND expression to be true is for one of the subexpressions to be true.
(True/False)
4.9/5
(34)
________ works like this: If the expression on the left side of the && operator is false, the expression the right side will not be checked.
(Multiple Choice)
5.0/5
(43)
What is the value of ans after the following code has been executed?
int x = 35;
Int y = 20, ans = 80;
If (x < y)
Ans += y;
(Multiple Choice)
4.8/5
(31)
Showing 41 - 58 of 58
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)