Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

Which of the following is not an attribute of a base?

Answered: 1 week ago