Solved

Which of the Following Conditions Can Be Added to the Code

Question 117

Multiple Choice

Which of the following conditions can be added to the code below so it will loop until the user enters "no" or "NO"? Scanner in = new Scanner (System.in) ;
System.out.print ("Continue? ") ;
String response = in.next() ;
While (/* put condition here */)
{
System.out.println ("Hello beautiful!") ;
System.out.print ("Continue? ") ;
Response = in.next() ;
}


A) response.equals("no") != response.equals("NO")
B) !(response.equals("no") || response.equals("NO") )
C) !response.equals("no") || !response.equals("NO")
D) !(response.equals("no") && response.equals("NO") )

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions