
Blockquote
Hi can you help with the program below,the program is a loop that prints out a code and a quantity when prompt for the user input.what I need is to modify the code to incorporate a dialogue asking whether another customer order is going to be placed so that it can processed an indefinite nunber of customers.Thank you!
import java.util.*;
class Output
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("Enter Code (XX to stop)" );
System.out.print("Code:" );
String code=input.next();
System.out.print("Quantity: ");
int quantity=input.nextInt();
while(!code.equals("XX")){
System.out.print("Code:" );
code=input.next();
if(code.equals("XX")){
break;
}
System.out.print("Quantity: ");
quantity=input.nextInt();
}
}
}

import java.util.*;
class Output {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.print("Code:" );
String code=input.next();
System.out.print("Quantity: ");
int quantity=input.nextInt();
String check="";
while(!check.equals("no")){
System.out.print("Is there another Customer order?(yes/No) :");
check=input.next();
if(check.equals("yes")){
System.out.print("Code:" );
code=input.next();
System.out.print("Quantity: ");
quantity=input.nextInt();
}
else{
break;
}
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.