I need the code to print "Invalid Response" if the user does not enter "yes" or "no", and wish to know the simplest way you can do this. Thank you!
import java.util.Scanner;
public class Closet
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.println("Welcome to your closet! Let's see what you can wear!");
System.out.println("Is it cold outside?");
String cold = scan.nextLine().toUpperCase();
if (cold.charAt(0) == ('Y'))
{
System.out.println("You should wear long sleeves.");
}
if (cold.charAt(0) == ('N'))
{
System.out.println("You should wear short sleeves.");
}
}
}