Question: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).

Then create a new Java application called "PhoneNumberConversion" (without the quotation marks) based on the Horstmann textbook chapter 2 programming exercise, Business, p 2.23.

Request the ten-digit phone number from the user at the command line.

Output should prints string 10 numbers into form (XXX) XXX - XXXX <------ I can't figure this part out.

-------------------------------------------------------------------------------------------------------

My code:

package phonenumberconversation; import java.util.Scanner; public class PhoneNumberConversation {

public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter ten-digit phone number: "); String pk = sc.next(); System.out.println("Your phone number is "+pk); // TODO code application logic here } }

---------------------------------------------------------------------------------

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!