adding a dialogue
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();
}
}
}
View Answers
February 1, 2012 at 12:30 PM
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;
}
}
}
}
Ads
Related Tutorials/Questions & Answers:
adding a dialogue
adding a dialogue 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
ModuleNotFoundError: No module named 'dialogue'
ModuleNotFoundError: No module named '
dialogue' Hi,
My Python... '
dialogue'
How to remove the ModuleNotFoundError: No module named '
dialogue... to install padas library.
You can install
dialogue python with following
Advertisements
adding loop
adding loop Hi I have a program that is not compiling when I add a loop can you help me?The program below is compiling without the loop.
> Blockquote mport java.util.*;
import java.text.*;
import java.util.Scanner
Adding two numbers
Adding two numbers Accepting value ffrom the keyboard and
adding two numbers
adding groups in contacts
adding groups in contacts how to add groups in contacts using servlet and jsp????pls help.thanku in advance
Dynamically adding textbox and labels
Dynamically
adding textbox and labels Sir,
In my application I want to insert texbox and labels dynamically and want to insert database field value in that generated label.
Plz help me,
Thanks in advance
webservices adding in eclipse
webservices
adding in eclipse hi team,
i am working on webservices,
please guide me how to add webservices in eclispe with step by step and give some examples also.
Please visit the following link:
http
Adding images in itext pdf
Adding images in itext pdf Hi,
How to add image in pdf file using itext?
Thanks
Hi,
You can use following code:
PdfWriter.getInstance(document,new FileOutputStream("imagesPDF.pdf"));
Read more at Inserting
Java: Adding Row in JTable
Java:
Adding Row in JTable how about if we already have the JTAble created earlier.
And i just found nothing to get its DefaultTableModel, thus, I can't call insertRow() method.
Is there any work around for this?
I found
jtable-adding a row dynamically
jtable-
adding a row dynamically hi..i am doing a project for pharmacy ..
*pblm:*
when i want to enter the details in jtable while running the application there are 3 rows and 4 columns which is default bt when we we have
Adding JTable into existing Jframe.
Adding JTable into existing Jframe. i need to add JTable into this code pls help me..
package Com;
import Com.Details;
import java.awt.Color...(100,60,1300,600);
add(pane);
//Action Listener for button
//for
adding new
Adding JTable into existing Jframe.
Adding JTable into existing Jframe. i need to add JTable into this code pls help me..
package Com;
import Com.Details;
import java.awt.Color...(100,60,1300,600);
add(pane);
//Action Listener for button
//for
adding new
Adding JTable into existing Jframe.
Adding JTable into existing Jframe. i need to add JTable into this code pls help me..
package Com;
import Com.Details;
import java.awt.Color...(100,60,1300,600);
add(pane);
//Action Listener for button
//for
adding new