Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which of the following can be used in the expression after keyword case? A. a co

ID: 3851507 • Letter: W

Question

Which of the following can be used in the expression after keyword case?
A. a constant integral expression.
B. a character constant.
C. a constant.
D. an enumeration constant.

Q2. Which statement below is not true?

Q3. Consider the classes below:

public class TestA
{
public static void main(String args[])
{
int x = 2;
int y = 20
int counter = 0;
for (int j = y % x; j < 100; j += (y / x))
counter++;
}
}

public class TestB

{
public static void main(String args[])
{
int counter = 0;
for (int j = 10; j > 0; --j)
++counter;
}
}

Which of the following statements is true?

A and B.

Explanation / Answer

Q1. Which of the following can be used in the expression after keyword case?

Answer: All.

After case keyword, we can use below all options.

A. a constant integral expression.
B. a character constant.
C. a constant.
D. an enumeration constant.

Q2. Which statement below is not true?

Answer:

B. Structured programming requires four forms of control.

Question 3

Answer:

D. The value of counter will be the same at the end of each for loop for each class. But the value of j will be different for each loop for all iterations.

At the end of each for loop, the counter value is 10 and j value is different for both the for loop iterations.

TestA class for loop, j values are follows

10

20

30

40

50

60

70

80

90

TestB class for loop, j value values are

9
8
7
6
5
4
3
2
1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote