Question: Create a method changeString with two string parameters wordA and wordB. Method should swap the first two characters in these strings wordA and wordB and

Create a method changeString with two string parameters wordA and wordB. Method should swap the first two characters in these strings wordA and wordB and output the results.

Example of method call: changeString(banana,apple);

Output should be apnana, baple

Example of method call: changeString(memo,review);

Output should be remo, meview

In the main method ask the user for two words with 3 or more letters(Ask the user again if the word has less than 3 letters) and then call the method changeString with these words as parameters.

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!