Analyze the following program fragment:

int x;
double d = 1.5;

switch (d) {
case 1.0: x = 1;
case 1.5: x = 2;
case 2.0: x = 3;
}
a. The program has a compile error because the required break statement is missing in the switch statement.
b. The program has a compile error because the required default case is missing in the switch statement.
c. The switch control variable cannot be double.
d. No errors.


c The switch value cannot be a floating-point number. So the correct answer is C.

Computer Science & Information Technology

You might also like to view...

Which of the following should you NOT do to secure a wireless network?

a. Implement media access control. b. Keep the default network name and router password. c. Create a security encryption passphrase. d. Disable SSID broadcasting.

Computer Science & Information Technology

An adjustment handle is identified by a ________

A) green square B) yellow circle C) blue triangle D) red circle

Computer Science & Information Technology

Match the Access options dialog box category with the best choice.

A. Sets default interface, file format, default database folder, and user name options B. Determines whether the windows are overlapping or tabbed and whether the database compacts on close C. Determines the default gridlines, cell effects, and fonts D. Determines default Design View settings; also provides default error-checking options E. Provides a way to manage trusted publishers, locations, documents, and macro settings

Computer Science & Information Technology

Which three object types can be stored in the Content Library? (Choose three.)

A. vDS backups B. VM templates C. vAPP templates D. ISO files

Computer Science & Information Technology