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 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;
            }
           }
        }
}









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
Adding an employee
Adding an employee  coding for adding an employee
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
javascript adding a value to an array
javascript adding a value to an array  How to add a value to a function argument or an array in JavaScript
adding view to viewcontroller
adding view to viewcontroller  How to add a frame window that opens on button click .. in iPhone application
adding groups in contacts
adding groups in contacts  how to add groups in contacts using servlet and jsp????pls help.thanku in advance
Adding photo to iPhone simulator
Adding photo to iPhone simulator  Hi, there is no photo in my iPhone simulator.. how can i add one? Please suggest. Thanks
adding buttons - Swing AWT
adding buttons  can u plzz explain how to add button to a dialog box and make them perform some event on the image loaded on the panel
adding buttons - Swing AWT
adding buttons  can u plzz explain how to add button to a dialog box and make them perform some event on the image loaded on the panel
testcase for adding - JUNIT
testcase for adding  hi deepak...I am new to junit.can u send me a JUnit test case for adding or multiplying of two numbers.please i need it urgently
Adding Jar into Eclipse
Adding Jar into Eclipse  Hi, Please provide Step by step procedure to add jar, tld files and configurations in Eclipse Helios version and i am using Jboss5. Thanks&Regards, Shiva sADS_TO_REPLACE_1
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
Adding customitem in canvas in J2ME?
Adding customitem in canvas in J2ME?  In J2ME how should we add a customitem inside the canvas.Because i need to perform key event handling for customitem.The key event handling is allowed in canvas not in form.So i try to use
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
Adding checkbox to List as item
Adding checkbox to List as item   can we add checkox to List   Hi Friend, Try the following code:ADS_TO_REPLACE_1 import java.awt.*; import javax.swing.*; import java.awt.event.*; public class CheckBoxInList
Dyanmically Adding Rows
Dyanmically Adding Rows  Hi sir Am doing project in that i need to add date picker in dynamically adding rows but the dates are storing in first test box only ill paste my code debug that code as soon as possible. Regards
adding the delete code
adding the delete code  hello sir... i need to add a delete button to my code but i didn't know where can i put it.. i've tried but still not working.. please help me...this is the code.. package newproject1; import java.awt.
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
Adding button to each row for the table and adding row to another table
Adding button to each row for the table and adding row to another table  Hi I need to add button to each line in the table(Table data is retrived form database) and need to add that column data which we click in the specified
problem in adding a fullscreen frame nd adding a glass pane to it
problem in adding a fullscreen frame nd adding a glass pane to it  hi , here is my code import java.awt.*; import javax.swing.*; import java.awt.ToolKit; class MyFrame extends Jframe{ Container c; JPanel glass; MyFrame
Dyanmically Adding Rows with Date Picker
Dyanmically Adding Rows with Date Picker  Hi Sir, I am doing a project in that i need to add rows dynamically with date picker inside row, send me code as soon as possible. Regards, Santhosh
Adding a text file - Java Beginners
Adding a text file  Hello, I need a program that will search a text file of strings representing numbers of type int and will write the largest and the smallest numbers to the screen. The file contains nothing but strings
Example code of adding placeholder in UItextFeild
Example code of adding placeholder in UItextFeild  Ho to add add the placeholder text in UITextField in IOS program programmatically? Thanks   HI, Its easy to add the placeholder in UITextfield programmatically. Here
adding one element in dictionary python
adding one element in dictionary python  Hi, I am looking for code for adding one element in dictionary python. Thanks   Hi, Here is sample code: dict ={"name":"Rose India"} print(dict) #add one more element dict
Adding .txt files in a given directory
Adding .txt files in a given directory  I want to read number of XML files from a given directory and extract tag value from body tag and add each tag value as one .txt file in a given directory? I have extracted tag values
Adding a Reports tap in table pool
Adding a Reports tap in table pool  strong textHow to write a code to create a report in java using eclipse and link that report in jsp file that is written in jsf. I have to edit a jsp file that is written jsf there is a table
Adding maven plugin to Eclipse ide
Adding maven plugin to Eclipse ide  Hi, I want to add the maven plugin to Eclipse ide. But it asking logging credential. May i know which logging credentials and who we get the logging credentials . Given process i am using
Adding A Primary Key to an Existing Table
Adding A Primary Key to an Existing Table   Been trying to add a primary key to a MySQL table using Java for two days with no success. I'm new to Java and JDBC so bear patience with me. It connects to the database without problem
adding two numbers - Java Beginners
adding two numbers  hii friends....... this is my program:- import java.io.*; import java.util.*; import java.math.*; public class Add2Numbers{ public static void main(String args[])throws IOException{ int[] x=new
adding some value to new column
adding some value to new column   how to update a column having some value into new column that also have some value i need to add this two value in java using result set we can get all the column data but how to add these value
adding of two numbers in designing of frame
adding of two numbers in designing of frame  hello sir, now i'm create two textfield for mark1&mark2 from db.how to add these two numbers in another one text field.how to write a coding... if u have another one idea pls
adding mouse listeners to drop target
adding mouse listeners to drop target  import java.awt.*; import java.awt.dnd.DnDConstants; import java.awt.dnd.DragGestureRecognizer; import... with adding mouse listeners to "table" which is drop target, to accept drop
adding background image - Java Beginners
adding background image  how do i add background image to this code: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class sampleProg extends JFrame { JButton button = new JButton ("Result
adding a method to calculate a students grade
adding a method to calculate a students grade  The Following program which displays a students name, id and mark works fine. But when i tried to add a method to display the grade based on the mark of the student i cant seem
Version of com.nuecho>dialogue-runner dependency
List of Version of com.nuecho>dialogue-runner dependency
ModuleNotFoundError: No module named 'turberfield-dialogue'
ModuleNotFoundError: No module named 'turberfield-dialogue'  Hi...: No module named 'turberfield-dialogue' How to remove the ModuleNotFoundError: No module named 'turberfield-dialogue' error? Thanks   Hi
ModuleNotFoundError: No module named 'dialogue-opentok'
ModuleNotFoundError: No module named 'dialogue-opentok'  Hi, My... named 'dialogue-opentok' How to remove the ModuleNotFoundError: No module named 'dialogue-opentok' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'dialogue-tester'
ModuleNotFoundError: No module named 'dialogue-tester'  Hi, My... named 'dialogue-tester' How to remove the ModuleNotFoundError: No module named 'dialogue-tester' error? Thanks   Hi, In your python
how to write a query for adding records in database
how to write a query for adding records in database  How write fire query in JSP for adding records in database
Adding a flex table in another flex table column
Adding a flex table in another flex table column  how to add a flex table in another flex table column
adding of 2 bite's - Java Interview Questions
adding of 2 bite's  Java Adding of 2 bite's  this through compilation failedhere a+b returns an integer .and u try to assign an integer value to byte.(i.e. narrowing or downcasting)In case of narrowing u have
adding two numbers using bitwise operators
adding two numbers using bitwise operators  adding two integer numbers with using bitwise opeators   Hi Friend, Try the following code...[] args) { System.out.println("Adding 5 and 6......"); int x=5,y=6; int xor
adding data to the database with the use of jtable - Java Beginners
adding data to the database with the use of jtable  how can i add data to the database with the use of jtable. and also can able to view the records in the database in the table.. tnx :G

Ads