Question: write the method called replaceString which takes a String argument. The method will pick a random integer representing one of the characters in the String

write the method called replaceString which takes a String argument. The method will pick a random integer representing one of the characters in the String and returns a String that has that position in the String replaced with a "9".

ex

replaceString("Dude") returns "9ude" or "D9de" or "Du9e" or "Dud9"

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 Programming Questions!