Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started