Which of the following is true aboutcaseclauses in aswitchstatement?

A. they must contain abreakstatement
B. the value can be a literal constant
C. the data type can be different from the selectorExpression
D. eachcaseclause has adefaultclause

Answer: B

Computer Science & Information Technology

You might also like to view...

The client-server model can only be applied to ring and star topologies.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following statements is false?

a. Use list method extend to add all the elements of another sequence to the end of a list (this is the equivalent of using +=). b. The following code adds all the characters of a string then all the elements of a tuple to a list: sample_list = [] s = 'abc' sample_list.extend(s) t = (1, 2, 3) sample_list.extend(t) c. Rather than creating a temporary variable, like t, to store a tuple in Part (b) before appending it to a list, you might want to pass a tuple directly to extend. In this case, the tuple’s parentheses are optional, because extend expects one iterable argument. d. All of the above statements are true.

Computer Science & Information Technology