Multiple Choice
Suppose a phone number, stored as a ten-character string (of digits only) called phoneNumber must be converted into a string that has parentheses around the area code.Which statement below will do that?
A) String newNumber ="("+
phoneNumber. substring (3,0) +") ";
B) String newNumber ="("+") "+ phoneNumber;
C) String newNumber ="("+
phoneNumber. substring (1,3) +") "+ phoneNumber. substring (3,7) ;
D) String newNumber ="("+phoneNumber.substring (0,3) +") "+ phoneNumber. substring(3, 10) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q110: Which of the following statements is correct
Q111: Which one of the following is a
Q112: What is wrong with the following code
Q113: How do you extract the first 5
Q114: Assuming that the user inputs a value
Q116: Which one of the following operators computes
Q117: What will be the value stored in
Q118: What is the output of the following
Q119: What will be the value of the
Q120: Which is the mathematical equivalent of the