How do you make the program repeat itself?

How would I make it so that when the if statement at the end of the code the program starts over from the begining?
Any help appreciated. Here is the code if you wanna see it.
import java.io.BufferedReader;
import java.io.InputStreamReader;
class SuperTester{
     public static void main ( String[] args ){
     // Create array that will hold deck
     Deck[] decko = new Deck[52];     
     // Fill the array with a deck
     decko = Deck.makeDeck();
     // Print new deck
     System.out.println( "PRINT NEW DECK" );
     System.out.println( "" );
     Deck.printDeck( decko );
     // Shuffle the deck ( simulated riffle shuffling )!
     decko = Deck.shuffleDeck( decko );
     // Print the shuffled deck
     System.out.println( "" );
     System.out.println( "PRINT SHUFFLED DECK" );
     System.out.println( "" );
     Deck.printDeck( decko );
     // Print first 5
     System.out.println( "" );
     System.out.println( "PRINT TOP 5" );
     System.out.println( "" );
     Deck.printFirstFive( decko );
     // Print single card
     System.out.println( "" );
     System.out.println( "PRINT SINGLE CARD" );
     System.out.println( "" );
     Deck.printCard ( decko [2] );
     System.out.println( "" );     
     BufferedReader in = new BufferedReader( new InputStreamReader (System.in));
     int input;
     System.out.println( " Do you want to re-run program? " );
     System.out.println( " Push 1 for yes " );
     System.out.println( " Push 2 for no " );
     System.out.println( "" );
try
     input = Integer.parseInt( in.readLine() );
catch( Exception e ){
if ( input == 1 ){
//WHAT DO I PUT HERE TO MAKE THE PROGRAM REPEAT ITSELF?
     } // end method
} // end class

So i should just do something like?
int x = 0;
while (x == 0){
//code
if (inpu == 1) {
    x == 0;
}else{ x == 1; }                                                                                                                                                                                                                                                       

Similar Messages

  • How do you make the program start?

    I have installed PSE 11 twice, now; the second time after an uninstallation of the first installation.  Both times, the program started immediately FROM the installation.  After exiting from the program, I have not been able to restart the program.  I click on it; I double click on it (which should start 2 copies of the program!); I right click and click Open; I right click and click "open as administrator".  Absolutely NOTHING happens.  Is there some sort of glitch that means you have to leave the program open permanently?  Please, how do I open the program? 
    Thank you.
    Cherie Brumfield

    Thanks so much for responding.  As it happens, I had already tried that
    approach, with no results.  I also spent some time last evening with a tech
    on the Adobe Chat page, also with no results.  So I just reloaded my PSE 8
    program, which does still work!  And this morning I get a notice of an
    Adobe update to PSE 11 and, guess what?!--NOW PSE 11 works just fine!!  Go
    figure!
    All of which has nothing to do with you having responded to my plea for
    help.  I really appreciate someone responding; it's nice to know that
    people "out there" really do care.  Thank you.
    Cherie
    On Wed, Feb 6, 2013 at 4:55 AM, bridge_mastero

  • How do you make to program the radio station on my remote contol ?

    how do you make to program the radio station on my remote contol ?

    Programming the radio stations (in hifi-mode) is explained in the "getting started" manual. Be aware of the fact that when you unplug the power cable all memory settings are lost.
    JaDi.

  • How do you make the sentences you input in a drop down list wrap to the next line?

    How do you make the sentences that you input in a drop down list to wrap to the next line?

    You can't.
    see this thread for more info:  Can you set drop down list as multi-line???

  • How do you make the background of an object transparent in Adobe Illustrator?

    Hello Forum.
    How do you make the background of an object transparent in Adobe Illustrator?
    I have been having issues with using the Magic Wand tool in Adobe Illustrator as well as the lasso tool.
    Basically, I am trying to put a small graphic into a new Illustrator file.
    The first thing I tried to do is to use the magic wand tool.  But I found out that this did not work on a jpeg image since it did not have any individual objects to select.
    So I tried something new.  I opened the file in Adobe Photoshop and used the lasso tool to select an area.  Then I coped this area.  Then I tried to paste it into Adobe Illustrator.  But the background was not transparent for the pasted image.
    How do I make the background transparent.
    I made this small video to show what I am talking about:
    http://youtu.be/2LgMGEF6z10

    Don't Copy/Paste the image.
    Make it transparent in Photoshop, save a PSD and place it in Illustrator

  • In windows 8 how do you make the bookmarks column "flexible"? I used to be able to make it narrower.

    Windows 8 how do you make the bookmarks column "flexible"?

    Is the problem with the Bookmarks Sidebar -- the one you can open and close by pressing Ctrl+b? It does seem to have a minimum width and won't get narrower than that, but I'm not sure whether you are running into that limitation or whether for some reason you are not getting the resizing arrow when you mouse over the thin border between the sidebar and the page.

  • How can I make the ipod stop itself after playing one song?

    How can I make the ipod stop itself after playing one song?

    When playing a song, are the controls at the top of the screen there? (Genius, Shuffle, Loop?)
    If not, tap the center of the page once to expose them
    now keep tapping the circle on the left part of the exposed controls untill a one (1) appears...

  • TS2755 Is there a fix to deleting already deleted address book contact, from messages search? i.e. when you type in say letter c in messages search, all contact with a c, past already deleted and current all appear?  How do you make the old deleted ones a

    Is there a fix to deleting already deleted address book contact, from messages search? i.e. when you type in say letter c in messages search, all contact with a c, past already deleted and current all appear?  How do you make the old deleted ones appear?

    only way is to restore the phone as new.  OR wait until IOS 7 comes out in the fall.

  • Tried the posted solution for the RETR problem and it works once then it returns. How do you make the change permanent?

    Tried the posted solution for the RETR problem and it works once then it returns. Once the email dl'ds the file deleted per the instructions returns. How do you make the change permanent?

    Hi DOC808HI
    # I don't know what you mean by "posted RETR solution". Could you please post a link to the suggested solution? Perhaps you are referring to this thread: https://support.mozilla.org/en-US/questions/991792 ?
    # Anyhow any further troubleshooting information you can provide will be great e.g. Your Operating System Version (XP, 7, Mac OS X Mavericks), your anti-virus if any, your mail provider, your ISP, what you did, what happened with exact error message, what happened
    Cheers!
    ...Roland

  • On a 5s how do you make the light turn off when phone rings or when you receive text, at work I would like to shut that off. Also seems like vibrate doesn't always work?

    On a 5s how do you make the light turn off when phone rings or when you receive text, at work I would like to shut that off. Also seems like vibrate doesn't always work? I had a 4s and didn't have these issues

    Thank you, I did find that. Still my phone does not always vibrate when ringer is off for texts and calls, only sometimes?

  • HT4111 how do you make the hippih keyboard pair with an ipad

    how do you make the hippih keyboard pair with an ipad

    I know this question is old but I just found out the real answer. After you turn on the little switch on the left side of the HIPPIH AppsKey Keyboard and the blue light blinks, I want you to look just above it.   Do you see that hole right above the word PAIRING?  Go grab a paper clip and press down in to the hole for about 2 seconds.   This sends a signal to the ipad and in the BLUETOOTH menu you should see "Keyboard" under DEVICES. Click on it and dialogue box will pop up asking you to put in a passcode for the keyboard.
    It took me way too long to figure this out.
    Stupid recessed button.

  • How do i make the program hold after it has created a JFrame

    I have created a JFrame with which the user shall login to a server. I call this JFrame from my main method (the JFrame-class is in a separate file). My problem is that after the login-window is created and set visible, my main method continues, i would like it to wait until the user have logged in before running the rest of the code.
    this i my main method:
    new LoginWindow();
    System.out.println("Logged in: "+Session.isLoggedin()+
                    "\nUsername: "+Session.getUsername());Session.isLoggedin() returns a boolean, true if user is logged in and otherwise false. class LoginWindow extends JFrame.
    i have tried to use a while-loop to solve my problem:
    while(!Session.isLoggedin()) { }and also
    whiel(true){
        if(Session.isLoggedin())
            break;
    }these while-loops never breaks, i have waited for about 3 min after successful login.It isn't because Session.isLoggedin() returns false, it does return true after a successful login (i've checked).
    the funny thing however is if i print something in the while-loop i does break when login is finished
    example:
    whiel(true){
        System.out.println(Session.isLoggedin());
        if(Session.isLoggedin())
            break;
    }this code makes the program wait until the login-phase is complete but i don't want it to print "text" a few thousand times while the user is logging in. (i've used "hej" as output aswell)
    Since i have no idea how long it will take for a user to log in i can't use the System.sleep(value) method.
    I would really appreciate any help
    Thanks in advance
    //Oscar

    SnuShogge wrote:
    I am still curious about why the while-loop only breaks if i print something using System.out.println(""), i didn't think that would make a difference since the break-statement remains the same.In general you should avoid trying to use while (true) or its variants in a Swing GUI as it often messes with the EDT, the main thread that renders the GUI graphics and interacts with the user.
    My problem i however partially solved by using a JDialog instead of a JFrame. I am planning on using JFrame later in the program so the problem might come back to haunt me if it isn't solved.This may not be a great idea. Usually an application has one single JFrame. Most other distinct windows a dialogs of one sort or another and should be JDialogs, not JFrames. Often better still is to use a CardLayout to swap JPanels or other components.

  • How can you make the iPod tell the diff between a movie and music video

    Greetings!
    How can you make iPod tell the difference between a Music Video and Movie? Everything I put up on the iPod falls into Movie. So is it something I have to do in iTunes?
    Thanks for the help!

    Rightclick the video in iTUnes, hit Get info then the "Options" tab. Beside kind you can set it to movie. music video. or TV show

  • How do you make the dashboard open automatically at login?

    Ok, you know in your dock you can right click on any application icon and it will come up with some options, one of them being "Open at Login." Well, I want to automatically open the dashboard at login, but when I right click on the dashboard icon it does not give that option. How do I make the dashboard open automatically when I log in?

    There is a freeware app called "Dashboard Starter" that will start the DB up when you log-in, or anytime you force quit the Dock.app.
    Search www.macupdate.com for it.
    iSMH

  • I just synced my iPhone and lost all the info in notes from my phone. It was replaced with whT was on my iMac how do you make the sync go from phone to desktop and not the other way around

    I Just synced my iPhone and lost all the info in notes I had on the phone. How do you have the info sync from phone to desktop and not the other way around as I usually make contact changes etc on my phone. I would then like to be able to sync that info from desktop to ipad thanks

    It does make sense.  The iPhone is a one-person device and just syncs to one computer.
    The way it should work is as follows:
    Old computer content ---> New computer
    New computer <---> syncs to iPhone
    But the way you are trying to operate sounds like:
    Old computer content ---> iPhone
    ... and ...
    New computer content <---> iPhone
    So simply move your old stuff (either directly from iTunes, or from a computer backup) to the new computer, have it all there, then sync your iPhone to the new machine.

Maybe you are looking for

  • Retenção de ISS na Venda de Serviço

    Boa tarde Estou utilizando ECC 6.0 e TAXBRA, preciso configurar a retenção do ISS pelo cliente na ordem de venda de serviços. No esquema de cálculo o sistema já está reconhecendo a alíquota do imposto e a retenção identificado pela condição ISVG. ISV

  • MacBook Pro A1286 Late 2008 WiFi Hardware Question

    I'm working on a Late 2008 15" MacBook Pro model A1286. It had a plethora of issues, from broken trackpad, broken keyboard, broken display panel and a shot hard drive. It wasn't working when I got it in so I couldn't verify much. Upon fixing all of t

  • MSS-Portal link with R/3

    Hi folks, We have a QA environment or the MSS-Portal running, linked to our R/3 QA system. It's working fine. Since we are preparing some tests for an SAP Upgrade phase, we need to link the MSS-Portal to a new R/3 server. The basis guys created a new

  • Remote login sun box to winOS box

    Hi I am as a root on sun (Solaris OS) box want to run some command on my remote site windows OS based system trying to connect via LAN to WAN and I have lists of users and his passwords for windows system. Could someone help me about how to connect a

  • Picture Optimizati​on Doesn't Work !!??

    Hi I have the latest version of desktop manager installed. I was trying to put photos from an SLR camera on my bb curve 8520. However the photos are resolution 3872 x 2592 (about 4.5 Mb on average). This makes viewing them (loading time) really long