String Encrypt = \"Encryption\"; String Decrypt = \"Decryption\"; System.out.pri
ID: 3619484 • Letter: S
Question
String Encrypt = "Encryption";String Decrypt = "Decryption";
System.out.println("Do you want to do Encryption or Decryption?");
Scanner sc = new Scanner(System.in);
String selection = sc.next();
while((!selection.equals(Encrypt)) || (!selection.equals(Decrypt)));
{
System.out.println("Do you want to do Encryption or Decryption?");
selection = sc.next();
}
I want the program NOT to continue unless "selection" is equal to "Encrypt" or "Decrypt". How do I make "Encrypt" and "Decrypt" case insensitive?
String Encrypt = "Encryption";
String Decrypt = "Decryption";
System.out.println("Do you want to do Encryption or Decryption?");
Scanner sc = new Scanner(System.in);
String selection = sc.next();
while((!selection.equals(Encrypt)) || (!selection.equals(Decrypt)));
{
System.out.println("Do you want to do Encryption or Decryption?");
selection = sc.next();
}
I want the program NOT to continue unless "selection" is equal to "Encrypt" or "Decrypt". How do I make "Encrypt" and "Decrypt" case insensitive?
How do I make "Encrypt" and "Decrypt" case insensitive?
Explanation / Answer
} //note that java is case sensitive ...so you should give the exact same string as InputRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.