Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions