// Program 43: Replace Vowels with the Succeeding Letter import java.util.*; class VowelSuccessor { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter a sentence: "); String s = sc.nextLine(); String result = ""; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); switch (ch) { case 'a': ch = 'b'; break; case 'e': ch = 'f'; break; case 'i': ch = 'j'; break; case 'o': ch = 'p'; break; case 'u': ch = 'v'; break; case 'A': ch = 'B'; break; case 'E': ch = 'F'; break; case 'I': ch = 'J'; break; case 'O': ch = 'P'; break; case 'U': ch = 'V'; break; } result += ch; } System.out.println("Original: " + s); System.out.println("New sentence: " + result); } }