What is y after the following switch statement is executed?
```
int x = 3; int y = 4;
switch (x + 3) {
case 6: y = 0;
case 7: y = 1;
default: y += 1;
}
```
a. 1
b. 2
c. 3
d. 4
e. 0
b. 2
Since x is 3, x + 3 is 6. So, case 6 is executed. Since there is no break statement, the statement in the next case is executed. y is now 1. Finally y += 1 adds 1 to y. So y is 2. The correct answer is B.
You might also like to view...
To order an array of strings in alphabetical order, the sorting algorithm should be structured to sort in __________ order.
a. alphabetic b. numeric c. ascending d. descending
Small caps, shadow, and strikethrough are examples of ____.
A. font groups B. font themes C. font styles D. font effects
Match the following terms to their meanings:
I. Microsoft InfoPath II. Form template III. Permissions IV. Groups V. Users A. Used to consistently collect the data stored in the library B. Define the level of access that is granted C. Provides the technology for designing form templates D. Can be identified individually or as part of one or more groups E. Created with unique names to represent multiple people
Forms in a traditional desktop database are called screens in an Access Web app.
Answer the following statement true (T) or false (F)