I want to be able to make my if statement restart the program if "Yes" is inputted, end the program if "No" is imputed, and say "Capitalization is important" if neither "Yes" or "No" is inputted.
Scanner sc = new Scanner(System.in);
final String vowels = "aeiouAEIOU";
System.out.println("Enter your word:");
String word = sc.nextLine();
while (!word.equalsIgnoreCase("done"))
{
String beforVowel = "";
int cut = 0;
while (cut < word.length() && !vowels.contains("" + word.charAt(cut)))
{
beforVowel += word.charAt(cut);
cut++;
}
if (cut == 0)
{
cut = 1;
word += word.charAt(0) + "w";
}
System.out.println(word.substring(cut) + beforVowel + "ay");
Scanner keyboard = new Scanner (System.in);
System.out.print("Do you wish to convert another setence ");
String name = keyboard.nextLine();
if(name = "Yes"){
new Prog508a().launch;
}
if(name = "No"){
break;
}
else{
System.out.print("Capitalzation is important.");
}