Essay
Assertions
For each of the five points labeled by comments, identify each of the assertions in the table below as either being always true, never true, or sometimes true / sometimes false. (You may abbreviate them as A, N, or S.)
public static int funky(int a, int digit) {
int count = 0;
// Point A
while (a != 0) {
// Point B
if (a % 10 == digit) {
count++;
// Point C
} else if (count > 0) {
count--;
// Point D
}
a = a / 10;
}
// Point E
return count;
}
Correct Answer:
Verified
Related Questions
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents