Question: Sanple Run: > Java Strings abcdefe gfedcba b) Write a method celled splitNunber that reads a line from the consists of an international phone number

 Sanple Run: > Java Strings abcdefe gfedcba b) Write a method

Sanple Run: > Java Strings abcdefe gfedcba b) Write a method celled splitNunber that reads a line from the consists of an international phone number cansole using the Scanner ocject, whach fors x-xxxxoome) The method shouid then spit the number into its three components and then print each of them Sample Run: java Strings Please Enter your phone number in the tollowing format: "country-ares-phone" (e.g. 1-516-7653423): 1-992-6727634 The phone number after split is: Country Code: 1 Area Code: 982 Phone Nurber: 6727634 c) write a method caliled FunFoo that reads a ine L iseved in a variable origina Strinel and a character c, from the user using the Scanner object (hint the Scanner object does then insert the character read from the consale Into the middle of the string creating a string variable cafed newstring. The method should then reverse the (newString) resuting in a string calied reversedString. The methoe should finally print out whether the newString and the reversedString are equat. Note: the method must receive the Scanner object as parameter. Note that you can ute your own method to split the string or you con use the buit-in split method for Strings read dreetly a character) The methed shoule Sample Run java Strings Enter your String: ababab Enter your character: x The original string is: ababab Spring 2014-13

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!