I need to replace all the vowels with the letter that the user input when they choose option 2
how do i get the user input and replace?
Heres what i have for my code so far
`
import java.util.Random;
import java.util.Scanner;
public class ArrayLab
{
public static void main( String[] args )
{
final int SIZE = 10;
char letters[]={'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
char replace;
Scanner in = new Scanner(System.in);
// print menu
for (int i = 1; i <= 5; i++)
System.out.println(i + "Choose Option" + i);
System.out.println("6 to Quit");
// handle user commands
boolean quit = false;
int menuItem;
do {
System.out.print("Choose option: ");
menuItem = in.nextInt();
switch (menuItem) {
case 1:
System.out.println("You've chosen to display");
System.out.println( letters );
break;
case 2:
System.out.println("You've chosen to replace");
replace = in.toCharArray();
break;
case 3:
System.out.println("You've chosen to shift right");
// do something...
break;
case 4:
System.out.println("You've chosen lowercase");
// do something...
break;
case 5:
System.out.println("You've chosen average of array");
// do something...
break;
case 6:
quit = true;
break;
default:
System.out.println("Invalid choice.");
}
} while (!quit);
System.out.println("Quitting");
}
}`