Reference no: EM132201108
Write a Java program that inputs a ten-digit phone number, and then turns that ten- digit phone number into a more readable string with a pair of parentheses, a dash, and a space.
For example, if the user enters the value 5147447500 as input, your program should print the string (514) 744-7500.
Hint use integer division and integer remainder operations to compute the three required blocks of numbers: area code 514, prefix 744, and line number 7500.
For example, in Java, 5147447500L/ 10000000 is equal to 514.
A sample run of your program should produce the following output, where the user's input is shown inredfor clarity:
Enter a 10-digit phone-number: 5147447500
area code:514
prefix : 744
line number: 7500
PhoneNumber:(514) 744-7500