How do I create a simple stop commmand in an elementary Java program?

Hello all,
I am looking for a way to terminate a program when the user enters stop. I am using textpad, and I am running windows xp home. Here is where I need it....
System.out.print( "Enter employee name:" );
String nameOfEmployee = input.next();
System.out.println();
I need to be able to enter stop in the enter employee name area to terminate the program.
Thank you all for your advice.

dillmann74 wrote:
Hello all,
I am looking for a way to terminate a program when the user enters stop. I am using textpad, and I am running windows xp home. Here is where I need it....
System.out.print( "Enter employee name:" );
String nameOfEmployee = input.next();
System.out.println();
I need to be able to enter stop in the enter employee name area to terminate the program.
Thank you all for your advice.Do you know about if statements?
If not check out the java tutorials here
if you do then I don't understand your question.

Similar Messages

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • How do I create a simple gallery in iweb? I don't know much coding though!

    how do I create a simple gallery in iweb?
    I don't know much coding though so I struggle
    with some tips given on-line. I've spent many
    hours on it with no success. Helpful advice will be greatly appreciated.

    Instructions :
    http://www.wyodor.net/blog/archives/2010/03/entry_308.html
    Result :
    http://www.wyodor.net/_Demo/Fancy/Fancy2.html
    http://www.wyodor.net/mfi/Dide/Photos.html

  • How do I create a simple message board (forum)

    I am a BC new-bee. How do I create a simple message board (forum) in BC to use on a Muse site since no widget is available there.

    No worries,
    The simple way should be that:
    open your forum page in Muse
    under "object" > "insert HTML" > paste "{module_forum,a,}"
    click ok
    move the textbox to the right position
    now publish this page to your bc site
    if you have any forums set up in the admin of your site (http://yourdomain.com/admin) it should show you the title of the forum.
    if there are no forums set up, you will need to create a forum in bc (Modules > Forums)
    Try this and let me know how it turned out.
    [ advertising removed by admin ]

  • How to accessed,created and modified date of particular file in java

    Hi,
    I am facing one problem.
    I know how to get the modified date/time of file in java.
    but i don't know how to find created and accessed date/time of file in java.
    Thanks,
    Tejas

    I guess thats not possible in in Windows.
    But if u r trying it on a unix machine.
    You can use Runtime class to call exec on the command
    ls -l filename
    and then store the result in a file . And then take out the last modified time. But you cant get created time.
    Thats a clumpsy way i believe.

  • How to create a file under web application root from java program

    how to create a file under web application root from java program like an action class?

    like an action class?Huh? What exactly is your requirement?
    Creating a file is usually done with java.io API. Read the java.io tutorials how to play with files.

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How do I create a simple search program to search java console log

    I wanted to know how can I write a simple program to return a particular value from the java console.
    Let me give u a brief.
    There is an application that I use, say "XYZ".Every time I perform an action on "XYZ" a log gets created in the java console. One such thing in the log I want to search is "ANI" and the program/script shud return the value adjacent to it.
    Log Example:
    NumCTIClients:0 CallType:CALLTYPE_PREROUTE_ACD_IN
    ConnectionDeviceIDType:CONNECTION_ID_DYNAMIC
    ConnectionCallID:4 ConnectionDeviceID:"0"
    ANI:"9782755100" DNIS:"0006"
    DialedNumber:"8002755010" CED:"1"
    RouterCallKeyDay:145000 RouterCallKeyCallID:34320231
    CallVariable1:"1234567" CallVariable2:"0"
    CallVariable3:"0006" CallVariable5:"26000 123-45-6789
    Not Valid " CallVariable6:"1001123-45-6789
    26000000000038404LPCFAA" CallVariable7:"THIBAULT,
    JOHN C. " CallVariable8:"CISCO
    TESPHE " )
    Now my understanding is that whenever java logs in the console it appends at the top, i.e, first record stays on top of the log sheet.
    Now this script/program shud look up the top-most line which reads ANI and return the corresponding value which in the abv ex. was "9782755100"
    I wud also want a small button when clicked wud copy the "9782755100" to the clip board
    Edited by: SasK on Feb 9, 2008 6:09 PM

    dillmann74 wrote:
    Hello all,
    I am looking for a way to terminate a program when the user enters stop. I am using textpad, and I am running windows xp home. Here is where I need it....
    System.out.print( "Enter employee name:" );
    String nameOfEmployee = input.next();
    System.out.println();
    I need to be able to enter stop in the enter employee name area to terminate the program.
    Thank you all for your advice.Do you know about if statements?
    If not check out the java tutorials here
    if you do then I don't understand your question.

  • How can i create a simple netweaver portal page that shows text and images?

    Hi,
    i have a simple question or maybe it's not so simple.
    I am completly new to SAP Netweaver 2004s Portal. At the moment i'm trying to understand the struture of the whole thing. I already know how to create roles, worksets and pages and i know how to combine the different elements so a user can acces them.
    And now i want to create a simple portal page that shows text and images. Is it possible to create such a simple page with the portal content studio? What iView do i have to use?
    (I just want to create a start page with a welcome text on it.)

    Marc
    Considering that you would any ways go ahead with complex development from this simple start page I recommend create a Web dynpro Iview for your start page (include the Iview in your page).
    For putting the contents use Netweaver Developer studio to build a simple start page application and put your static text on that Iview.
    Please go through the following log after your NWDS development is over - This will make you comfortable for further challenging work.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b7/ca934257a5c96ae10000000a155106/frameset.htm
    Do reward points if this helps and let me know of you want anything more.

  • How do I create a simple flare?

    Hello,
    I am a total newbie to AI, so any help/advice would be greatly appreciated.
    I am trying to create a simple flare that will make my light bulb look like it is glowing really bright.  I have been fooling around with the flare tool, but I can not figure out how to change the colors of the flare, etc.
    I want the background of the flare to be transparent so that I can use it on any of my images and the image will show through.  There are 5 different color flares that I need since I have 5 different bulb colors...1 yellow, 1 blue, 1 green, 1 amber, 1 red.  I think that the scale should be about 25% height to 100% width...
    Also, I want the same affect for a lighthouse image that I would like to put together...Like the light from the lighhouse is really bright and a focal
    point.
    Any help?
    thx
    Mike

    There's a multitude of ways to draw flares. But let's explore the Flare Tool a bit more. After all, it's been sitting there occupying primary tool space in the Toolbox for years; might as well use it in the rare times you have occasion for it. To get a sense of the behavior, try the following exercise.
    (The following assumes a CMYK document.):
    Additional tips:
    Like so many Illustrator features, tweaking the settings in the Flare Tool's stupid modal dialog is excruciatingly tedious. Before clicking to create the Flare you are going to adjust, go to the View menu and Hide Edges. Turn on the Preview checkbox in the dialog. Now you'll be able to tell what your adjustments are making are doing, without Illustrator's annoying highlighting of every path in a selected Group. (Absolutely hideous interface. I despise this program!)
    Once you finallyget a Flare that you find useful, drag it and drop it into the Symbols Palette. Then save the Symbol Library somewhere for safe keeping, naming it UsefulFlares. Next time you work with Flares, load the library, even if you need a different Flare. When you manage to create another Flare you find useful, make it a Symbol, and export the Symbol Library again. (Do the same kind of thing with Brushes.)
    Flares stored as Symbols, of course, can also be colorized somewhat by using the Symbol Stainer. That's a quick way to add a little color variance to tiny flares used as stars. But it's rather unpredictable due to the Screen Opacity Mode.
    Don't be afraid to use two different Flares together. Store them together in the same Symbol.
    The highlights of the screw threads on the bulbs are just an ArtBrush made from an expanded radial black-to-white grad, applied off-center to a circle. The ArtBrush is frequently useful for specular lights on cylindrical surfaces. The Brush's colorization mode is set to Hue Shift. (When expanding the grad, remember: There's no need to go nuts with the number of steps. 10 is usually a gracious plenty.) Each screw thread is just a single curved path with two Strokes: A thick black stroke with rounded end caps and an added stroke for the highlight brush.
    JET

  • How can I create a simple chat function in a mobile app for iOS and Android

    I am wondering how can I create a chat function in my mobile app creating in AIR and Flex. The chat should be similar to the one in WhatsApp.
    Do you know some possible solutions?
    Thank you in advance!

    To enable chat messages, you need a server. The kind of server depends on the application. Do you want to create a chat like application like WhatsApp, where the server pushes messages without an active connection? Or do you have some sort of online game, where chat messages can only be transferred when the client is connected already?
    I have an online game where clients are connected to a Java server at all time. From there it is pretty straight forward:
    2 textfields:
    - 1 line textfield for input messages
    - multi-line textfield for chat history. Make sure the textfields autoscrolls to the bottom when the content changes
    on enter or button push, send a socket message to the server.
    the server broadcasts all messages to all clients that are subscribers of the chat group.

  • How can you create a simple insert or update trigger

    I am trying to create a simple insert or update trigger to timestamp an xml document when I load it into my XML DB repository but I always get an error trying to compile the trigger.
    "ORA-25003: cannot change NEW values for this column type in trigger"
    Here is my PL/SQL:
    CREATE OR REPLACE TRIGGER "PLCSYSADM"."PLCSYSLOG_TIMESTAMP"
    BEFORE
    INSERT
    OR UPDATE ON "PLCSYSADM"."PLCSYSLOG"
    FOR EACH ROW BEGIN
    :new.sys_nc_rowinfo$ := xmltype('<datestamp>' || SYSDATE || '</datestamp>');
    END;
    Does anyone have an example that works ?
    Thanks in advance
    Niels Montanana

    http://developer.apple.com/referencelibrary/HardwareDrivers/idxUSB-date.html

  • How do I create a simple "prize draw" program?

    Hey, I'd like to create a simple "prize draw" program
    that randomly selects a name (or number) from a list of names, I'd like it to be my own custom version. For a programmer this is probably the easiest thing but I'm new to programming (beginner), don't eve know if I'm in the right subcategory (flash). Is there a tutorial or something somewhere that you guys think could help me out, please?

    Create the list as an array and use the Math methods to randomly pick one of the values from the array.
    var prizeArray = new Array("name1","name2");
    var drawnPrize = prizeArray[Math.floor(Math.random()*prizeArray.length)];
    trace(drawnPrize);
    If you don't know if you should be using Flash, then you probably don't want to be looking for help until you figure out what you intend to do for your custom design.

  • How to to create new user in Azure AD by using C# programming manually

    Hi 
    I am using MVC 5 with Azure AD.
    I want to create new user in Azure AD by using C# programming manually, I don't want to configure it.
    Suppose I have an application where We have an option to create new user, so how we can write program for it.
    Thanks in advance!!

    Hello,
    Microsoft Azure forums are over here:
    https://social.msdn.microsoft.com/forums/azure/en-US/home
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How can I create Windows Explorer (as a Tree strucuture) in Java

    Hi All,
    How can I create a Windows explorer (as a tree structure) in a Frame window?
    Thanks
    Sumode

    File[] roots = File.listRoots();
         for (File root : roots) {
         System.out.println(root.toString());
         File[] directoryContent = root.listFiles();
         if (directoryContent != null) {
              for (File directoryFile : directoryContent) {
              System.out.println("File: " + directoryFile.toString());
         }

Maybe you are looking for

  • Whether installing 64bit OS is better than 32bit in a 64 bit PC?

    Hallo friends, Now a days 64bit PCs are more common. But I think Operating systems and programs have not attained  capacity to fully exploit the power of 64bit machines. (Of course Linux is better than MS counterparts in 64bit zone). If it is sensibl

  • OAS 10.1.2 Java Edition

    Does anyone know where I can download the OAS 10.1.2.0.0 "Java Edition" in a single download? I cannot find it on the download page of the OAS. Only the full "Enterprise Edition" is available there in 4 cd's... Regards, Stan

  • How do I control where downloaded items go on my desktop?

    I know this is a weird question, but I build charts online that I then download. They seem to download anywhere on my desktop... so I'm constantly having to hit F11 to move everything to find the chart I just downloaded. I leave space at the far righ

  • Discovery System v3 - Installation questions

    Hello all, We have the Discovery Server v3, with ERP and SOL instances. Some small questions regarding installation. We have a DB size of ~175Gb. Is it normal? We have a RAM consumption of 11Gb when both systems are started. Is it normal? In the Visu

  • Not able to see sidekick on adding an external Component

    Hi, I am just trying to add a component in my page PFB the code for the same <div id="newEntry" style="display:none;" ><cq:include path="newEntryList" resourceType="/apps/myProj/components/blog/entryform" /></div> This entryform is the one which is f