
Write a program that replaces a, e, i, o, u, with the letter z. (i.e. John Smith -> Jzhn Smzth. Also the program reverses the users name (i.e. John Smith -> htimS nhoJ)

Here is an example that replaces the vowels of string with the z and reverse the string.
class StringExamples
{
public static void main(String[] args)
{
String st="John Smith";
String replaceString=st.replaceAll("[aeiou](?!\\b)", "z");
System.out.println(replaceString);
char ch[]=st.toCharArray();
String revstring="";
for(int i=ch.length-1;i>=0;i--){
revstring+=Character.toString(ch[i]);
}
System.out.println(revstring);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.