Question: 4. Use a while loop to complete the following code based on the description in the comment header: /** * Continually prompts that user until

 4. Use a while loop to complete the following code based

4. Use a while loop to complete the following code based on the description in the comment header: /** * Continually prompts that user until they enter "yes" or "no" and then displays their response @author Hyrum D. Carroll @version 0.2 (June 25, 2020) */ import java.util.Scanner; public class User Response{ public static void main(String[] args ) { Scanner input = new Scanner(System.in); String prompt = "May I have another cookie? "; String response = ""; System.out.println( "You entered " + response ); } } 5. Rewrite the while loop in UserResponse to be a do-while loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!