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
Q19: Which statement is true?
A)Variables cannot be assigned
Q24: What is the meaning of x =
Q26: Consider the following Java variable names:
I.1stInstance
II.basicInt%
III.empName_
IV.addressLine1
V.DISCOUNT
Which of
Q37: Which one of the following is a
Q78: What is the value of the following
Q79: What does the following statement sequence print
Q82: What is wrong with the following code
Q83: What is wrong with the following code
Q87: When you purchase donuts, they come in
Q98: The first step in problem solving is
A)To
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