I'm just wondering if it would be possible to read in a String value with a Scanner,convert it to upper case, and use .equals("NO") in the same if statement. Basically, if the user enters 'no' 'No' 'NO' 'nO' it will change it to 'NO' and then perform .equals("NO") to check if the user wants to continue the program. Yes, I'm aware that the current syntax of the if statement parameters are incorrect, this is because I'm not sure how to do it. Would I be able to do toUpperCase and equals() in the if statement, or would I need to use a seperate toUpperCase statement?
right after public class program2 {
public static String cont="";
public static Scanner in=new Scanner(System.in);
within my main();
System.out.print("Continue? Yes/No >> ");
cont=in.nextLine();
if(cont.toUpperCase/equals("NO")
{
System.exit(0);
}
showmenu();
Additionally, since I'm using Syste.out.print() and System.out.println(), it would be helpful if there was a way to clear all text from the output window. Is there a way to clear the output window?