Question: b) public static String formatPhone Number(String myNumber, boolean option) i. Write the pseudocode for the program ii. Implement a static Java method which reads a

 b) public static String formatPhone Number(String myNumber, boolean option) i. Writethe pseudocode for the program ii. Implement a static Java method which

b) public static String formatPhone Number(String myNumber, boolean option) i. Write the pseudocode for the program ii. Implement a static Java method which reads a telephone number into a string variable, computes the formatted number based on user's choice of format and returns it as string. Example: If option is true, 2342342234 will become (234) 234-2234 If option is false 2342342234 will become 234-234-2234 iii. Test your method for both options. Write JUnit tests ii. Use the Scanner class to get input from the user (in main method) and pass that as a parameter to the method above. Get the returned value and print it along with the user input. Write JUnit tests

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!