Question: JAVA: Integer jeansCount is initialized with 0 . String nextItem is read from input. Using the following code, write a while loop that iterates until
JAVA: Integer jeansCount is initialized with String nextItem is read from input. Using the following code, write a while loop that iterates until nextItem is equal to "Done". In each iteration of the loop:
Increment jeansCount if nextItem is equal to "Jeans".
Read string nextItem from input. import java.util.Scanner;
public class SimpleWhileLoop
public static void mainString args
Scanner scnr new ScannerSystemin;
String nextItem;
int jeansCount;
jeansCount ;
nextItem scnrnext;
Your code goes here
System.out.printlnJeans occurs jeansCount times;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
