Do u have any suggestions for this

Hello Everyone. I am java biginer so i am stuck on one problem. As u can see in the code below i declared three numbers and when it asks user to enter is ...if the first number entered is 1OR if the first number entered is 1 and the second number entered is 2 i want the program to go back to the start of the while loop...BUT I DONT KNOW HOW....every time it just prints off "YOU WON" and just continues propmting user to enter second or third number number!!!
Here is the code...i appreciate everyones help!!
import java.awt.*;
import hsa.Console;
public class Whiletrue
static Console c;
public static void main (String[] args)
c = new Console ();
int num1;
int num2;
int num3;
while (true)
c.println ("HELOO...FIRST STEP ENTER INT FROM 1-5");
num1 = c.readInt ();
if (num1 == 1)
c.print ("You won ");
c.println ("SECOND STEP...INT FROM 1-5");
num2 = c.readInt ();
if (num1 == 1 || num2 == 2)
c.print ("You won");
c.println ("THIRD STEP INT FROM 1-5");
num3 = c.readInt ();
c.print ("THREE ");

import java.awt.*;
import hsa.Console;
public class Whiletrue
static Console c;
public static void main (String[] args)
c = new Console ();
int num1;
int num2;
int num3;
boolean check =true; //declare check as true
while (check) //if check is true go to loop
c.println ("HELOO...FIRST STEP ENTER INT FROM 1-5");
num1 = c.readInt ();
if (num1 == 1)
c.print ("You won ");
c.println ("SECOND STEP...INT FROM 1-5");
num2 = c.readInt ();
while(num1 == 1 || num2 == 2) //replaced if by while
c.println ("HELOO...FIRST STEP ENTER INT FROM 1-5"); //put prompt into loop if condition is true
num1 = c.readInt ();
c.println ("SECOND STEP...INT FROM 1-5");
num2 = c.readInt ();
c.print ("You won");
c.println ("THIRD STEP INT FROM 1-5");
num3 = c.readInt ();
c.print ("THREE ");
check =false; // after THIRD step set "check = false" to get out of loop

Similar Messages

  • I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for thi

    Hi,
            I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for this Certification Exam preparation materials from another 3rd party or from SAP directly .  I would like to prepare or get trained well before taking the exam as I see it costs around $500.
    Thanks in advance for your help in this regard!
    Sincerely,
    J

    Please search here.. Training and Certification Shop for your desired certification or training. Don't forget to set your location.
    Please use some summarized title for your query.

  • I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    Hi RonWM,
    Thanks for visiting Apple Support Communities.
    This article lists the ports that are used by the Apple TV:
    Apple TV: TCP and UDP ports and protocols used
    http://support.apple.com/kb/HT2463
    Best Regards,
    Jeremy

  • Does anyone have any suggestions for Ad blocking? I'm getting a lot of pop up ads while using Facebook from Safari.

           I'm getting a lot of pop up ads. mostly while using  Facebook. I'm running Safari on a Macbook Pro running Yosemite. Does anyone have any suggestions for an Ad blocker. I don't see anything in the App store.
          I can't swear to it but I don't recall this being a problem pre-Yosemite. I could be wrong. I haven't been real active on Facebook until recently. I see some third party apps out there but am alway wary of non approved software.
         Thanks
         Ron

    You may have installed the "VSearch" trojan. Remove it as follows.
    Malware is always changing to get around the defenses against it. These instructions are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data before proceeding.
    Step 1
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot," "Trovi," or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    Reset the home page and default search engine in all the browsers, if it was changed.
    Step 2
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "com.vsearch.agent.plist" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /System/Library/Frameworks/VSearch.framework
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the Internet criminal behind VSearch has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing has not done so, even though it's aware of the problem. This failure of oversight has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Does anyone have any suggestions for password protecting e-mail on the i pad?

    Does anyone have any suggestions for password protecting e-mail on the i pad?  Other people sometimes want to use my i pad but I don't want them to have access to my e-mail (which is on AOL)
    Presently you can password protect the whole i pad by having to put in a 4 digit code to open it, but once it's open whoever is using it has access to everything you have on it.

    Skydiver...that did it!!  I shut the mail app from automatically opening and now I can sign onto my AOL acct. through Safari!!  I had called Apple Care and had asked  different peope in Apple stores about this and no one but you had any suggestions!  YAY!!  Thanks!!!

  • I just received a new macbook pro. I am looking for a usb3 external storage 500 GB drive.  Some manufacturers of drives aren't for sure their drive will work with the new lion system. Does anybody have any suggestions for drives that will workw

    I just received a new macbook pro. I am looking for a usb3 external storage 500 GB drive.  Some manufacturers of drives aren't for sure their drive will work with the new  system. Does anybody have any suggestions for drives that will workw

    There seems to be a problem, just now, with the USB 3 ports on the new MBP's supporting eternal USB 3 drives. Some people have no luck at all - can't even recognize the drive - and some are reporting USB 2 speeds (those who drives are recognized). I'd call a dealer such as LaCie or OWC to see if they have USB 3 drives that actually work with MBP's with USB 3 ports. You may have to wait for a software/firmware update.
    Clinton

  • I bought my iphone 5 in Houston Texas May 15 2013 IMEI Nr. 013428009645399.The problem is that in the Greece the country which I live the 4G is not working.If you have any solution for this problem pls. let me know.My email is philcoueth@yahoo.gr Thank yo

    I bought my iphone 5 in Houston on May 15 2013.
    IMEI 013428009645399.The problem I have is that in the country
    which I live GREECE the 4G is
    not working.Please if you have any solution for this
    problem let me know.My email is [email protected]
    Thanking you in advance
    Philip Couridis

    iPhones purchased in the US are NOT guaranteed to work with 4G bands outside of North America.
    For what crazy reason did you purchase an iPhone in the US if you live in Greece?  If your phone needs servicing, it will have to be brought back to the US.  You cannot get that phone serviced in Greece.

  • Cannot display the screen of the macbook on TV. OS is Lion 10.7.2. Connection to the TV is over HDMI cable.  TV shows only the backgroud picture of Lion. Do you have any suggestions for help ?

    Cannot display the screen of my macbook on TV. OS is Lion 10.7.2. The Macbook is connected to the TV is over HDMI cable.  TV shows only the backgroud picture of the Lion OS and reacts even to mission control. Do you have any suggestions for help ?

    You have the display set in Extended Desktop mode. In System Preferences>Display on the MacBook screen there should be an Arrangement tab when you have the MacBook hooked up to the TV and both screens working. When you click the Arrangement tab do you see two monitors side by side? One of them will have a Menu Bar at the top. Just click on the Menu Bar and drag it to the second monitor. That will make the second monitor your main screen. You can now use your MacBook in Clamshell Mode with a wired or Bluetooth keyboard and mouse.  http://support.apple.com/kb/HT3131 When you disconnect from the TV your Menu Bar will automatically change back to the MacBook.
    Or if you want to work on the MacBook screen while showing it on a TV you can check the Mirror Display box on the lower left hand side of the Arrangement tab under the two monitors box.

  • I recently purchased a refurbed iMac with a 3.06 GHz Intel Core 2 Duo.  It came with iMovie ver. 9.0.5 installed.  I do allot with iMovie and iDVD and would like to get a camcorder to add movie clips.  Does anyone have any suggestions for a reasonably pri

    I recently purchased a refurbed iMac with a 3.06 GHz Intel Core 2 Duo.  It came with iMovie ver. 9.0.5 installed.  I do allot with iMovie and iDVD and would like to get a camcorder to add movie clips.  Does anyone have any suggestions for a reasonably price camcorder that would work with my setup?
    Thanks in advance for any suggestions.

    I recently purchased a refurbed iMac with a 3.06 GHz Intel Core 2 Duo.  It came with iMovie ver. 9.0.5 installed.  I do allot with iMovie and iDVD and would like to get a camcorder to add movie clips.  Does anyone have any suggestions for a reasonably price camcorder that would work with my setup?
    Thanks in advance for any suggestions.

  • I've just reformatted my pc, reinstalled master collection cs5, and now it won't install the updates it downloaded, do we have any fix for this?

    I've just reformatted my pc, reinstalled master collection cs5, and now it won't install the updates it downloaded, do we have any fix for this?

    you can update manually, http://www.adobe.com/downloads/updates/

  • I can't access any mote to a WD MY Book (WD5000H1Q). Does anyone have any suggestion about this issue?

    I cannot acces any moto to a WD MY Book (WD5000H1Q). After upgrading to Lions It worked for a couple of days. Does anyone have some suggestion on this issue?

    Do you see it on your desktop as an icon?

  • I used to open many tabs in the same page and i move from one to other by mouse but since3 two days the tabs open in the same page normaly but i can't move from one to other when i clik with mouse on any tab it don't open/ do u have any solve for this?

    i used to open many tabs in the same page and i move from one to other by mouse but since3 two days the tabs open in the same page normaly but i can't move from one to other when i clik with mouse on any tab it don't open/ do u have any solve for this

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Do You Have Any Suggestions For J2ME Encryption Applications?

    Hi,
    Is anyone aware of J2ME applications that perform either of the following:
    1) Text editor with strong crypto support.
    2) Password wallet with data import/export functionality and strong crypto.
    To date I have been unable to locate anything suitable to manage personal data on a mobile phone platform.
    I am considering developing the required app myself, but my lazy nature has suggested that I check to see if there is currently anything suitable available.
    Thank you in advance for any suggestions.
    Kind regards,
    JamesK

    Under settings you can go into restrictions and limit their access to certain things, such as purchasing apps, etc. But there is no net nanny for the iPad that I'm aware of. Nor is there any sort of 'parental monitor/logging' type of app that will log what they do and generate a report to you.
    If you want to get them something more locked down then you may be better served to look on sites like Toys R us or the such and look for items that give you more control.
    THe iPad was largely designed as a single user consumer device that allows a single person to surf, read books, watch movies, listen to music, etc. It's not totally meant to generate content, or for multiple users or for children, which is why there's not a lot of content control.

  • We saw this error in log, this is not hampering anything, but any suggestion for this.

    We saw this error in the log file, while running the application module, having two customize view objects added to it.
    java.sql.SQLException: invalid name pattern: FUSION_RUNTIME.FND_TABLE_OF_VARCHAR2_255
        at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:599)
        at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:506)
        at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:2143)
        at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:315)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:222)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:190)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:172)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:130)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createSession(ApplSessionManagement.java:323)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createSession(ApplSessionManagement.java:191)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createAttachedSession(ApplSessionManagement.java:663)
        at oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl.prepareSession(OAApplicationModuleImpl.java:875)
        at oracle.jbo.server.ApplicationModuleImpl.prepareSession(ApplicationModuleImpl.java:6892)
        at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:181)
        at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9075)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4603)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2533)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2343)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3242)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
        at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:516)
        at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:862)
        at oracle.jbo.jbotester.binding.TesterBinding.getApplicationModule(TesterBinding.java:189)
        at oracle.jbo.jbotester.binding.TesterBinding.initApplicationModule(TesterBinding.java:168)
        at oracle.jbo.jbotester.binding.TesterBinding.<init>(TesterBinding.java:164)
        at oracle.jbo.jbotester.binding.TesterBinding.<init>(TesterBinding.java:128)
        at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:632)
        at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:597)
        at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:428)
    any suggestion to remove this error.
    THanks
    VIpin

    Just to add on what it does:
    You are running the AM with username fusion_runtime which is granted privileges for fusion schema. On running the AM the ApplSession is created and a logon trigger is executed which sets the current schema to 'Fusion' (rather fusion_runtime). This results in wrong data type associations and causing the issue.
    The jvm parameter actually sets it back to 'fusion_runtime' and fixes the issue.
    Hope this helps
    vik
    Fusion Developer Relations Team
    http://blogs.oracle.com/fadevrel

  • ITunes will not download on my 64bit lap top. I have tried 6 times to download it.Does anyone have any ideas for this issue?

    I have tried 6 times to download itunes on my 64bit lap top. I keep getting error messages, and I have disabled the pop up blockers still nothing. Does anyone have any ideas?

    What do the error messages say? (Precise text, please.)

Maybe you are looking for

  • MBP is angry when iPhone is plugged in or Flash, Safari, or Fusion open

    By angry, I mean, close my 'notebook' (not LAPtop) if I am in class and wait for the fan to shut off due to embarrassment. Any of these things trigger it... If an iPhone is plugged in whether it is syncing or just charging. If I am surfing in Safari,

  • Import image in Map Builder

    When using the import image tool of Map Builder to create a GeoRaster theme, you may get a popup window with an error message saying that the import was not successful. The application console should contain the following lines. Creating GeoRaster Ta

  • SSIS 2012 loop once per row in a record

    Hi All,      I am new to 2012 and i am  not finding much help on the internet.  I have a control table that I need to use as a driver to loop through all my data/updates.  Using 2008r2 i would have used set up a result set holding the all the values

  • ISE web login Issue.

    Hi all:      Here is  the scenario.My ISE is a vmare version,and works normal,now here comes an issue, my computer can't login the ISE web interface. The other computer can login the ISE web interface.      I think it maybe the cert's issue,cause whe

  • Which Officejet All-In-One's take 350/350XL/351/351XL cartridges?

    Hi! I am in UK & want to buy a new HP Officejet all-in-one printer/scanner/copier (with or without fax facility). I already have a fair stock of HP 350/350XL & tri-colour 351XL ink cartridges & bearing in mind how much they cost, I think it would mak