Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago