Answer:
public static String stutter(String a ) {
String myText = "";
for (int i = 0; i < a.length(); i++) {
myText = myText + a.charAt(i) + a.charAt(i);
}
return myText;
}
Step-by-step explanation:
Programming language used: Java
public static String stutter(String a )
//Define a method stutter which is public (accessible from outside of the class) and static(accessible without creating the object of its class) and with a string argument
String myText = "";
//Defines an empty string
for (int i = 0; i < a.length(); i++) {
myText = myText + a.charAt(i) + a.charAt(i);
}
//loop through each character of the string and concatenate each character twice
return myText;
//return the final string