Rewrite the following if statement as an equivalent switch statement. The variable digit is of type int.
```
if (digit == 0)
value = 3;
else if (digit == 1)
value = 3;
else if (digit == 2)
value = 6;
else if (digit == 3)
value = 9;
```
```
switch (digit) {
case 0:
case 1:
value = 3;
break;
case 2:
value = 6;
break;
case 3:
value = 9;
}
```
You might also like to view...
MC Items are______ on and______ off a stack.
a) pushed, topped. b) placed, knocked. c) pushed, popped. d) None of the above.
As an insurance company, the customer data that you store on your servers should be considered which of the following?
A. threat B. vulnerability C. risk D. asset
If the catch-all exception handler is specified before another exception handler, a ______ may occur.
Fill in the blank(s) with the appropriate word(s).
When [blue] is listed as a format, all numbers display in blue
Indicate whether the statement is true or false.