Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help to do a do while loop on a java code. I want it to do loop a method the user just types
I need help to do a do while loop on a java code. I want it to do loop a method the user just types yes or Yes to run the loop again. I need to use an ignoreequalcase, but I don't know how to work it. This is what I have.
public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String answer; do { switchCase(); System.out.print("Enter \"Yes\" to go again."); answer=keyboard.next(); } while(answer=="Yes");//Work on making it to where both yes and Yes are equal }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started