Very quick Do while question!

Hey guys,
Quick question i somewhat forgot how to do the do while loop, heres what i think it looks like but it keeps giving me an error on the syntax.
Any pointers would help please.
do{
       //code goes here
while(y>x);Where does the last { go?
Thanks in advance!

I said in front of the while, not after it.
do
{Ok thanks the syntax error went away but when i run the loop it just runs past the question why?
do{
          if((side1+side2)>=side3)
                    System.out.println("The perimeter of the triangle is "+total);
          else
               System.out.println("The input is invalid:");
               System.out.println("The sum of side 1 and side 2 can't be greater than the third side!:");
               System.out.println("Would you like to try again");
               answer=scan.nextLine();
               }while(answer.equalsIgnoreCase("y"));
}It executes everything right except it doesn't let you enter an answer.

Similar Messages

  • Very Quick PF Input Question

    Hello.
    A quick question if I may. I am in diffs.
    What are/When to use the PF inputs?
    With regard to triggering data aquistiions, will wiring a +5V input to pfi0 work as a trigger?
    Thanks.

    Hello Brian. Thanks for the reply.
    I am using a 6071 card.
    PFI 0/AI START
    PFI 1/REF TRIG
    Perhaps I should be using the PFI 1 port?
    http://www.ni.com/pdf/products/us/4daqsc199-201_ETC_212-213.pdf
    Here is the link for the pdf of 6071
    Best Regards
    Thomas

  • Very quick and easy question

    I am making a catalogue, so I need a set of place-holder images which I am able to change he actual image on the following pages after the master one so that I can then move the master image place holders and have all the pages follow accordingly whilst respectivly keeping their different image assigned.
    In other words, is there any way I am able to set a 'place-holder' on master page, then assign different images to the following pages, then if I need to move the layout I can just move the place-holders on the master frame whilst keeping their own set images within the place holders.
    Thank you very much.

    There are a couple of approaches.
    Automatic page numbering is accomplished by putting a text frame on the master page and inserting a current page number marker. You can add additional information or text in the frame if you wish, and format to taste. The number will appear on all pages based on that master.
    Now for the different approaches. The first way is to just add them independently to each master page. However, if you use masters based on one or more other masters to control things that are basically the same (i.e. you have repeating elements on at least two masters, but something else that's different) you can create a "parent" page and put the numbers on that, then base other master pages on the parent, and everything on the parent will be included in the "child" page. You can Ctrl + Shift Click to select and remove an item if necessary. If you want to edit the repeating elements you do it on the parent page, and the change propagates through to the children.
    If you want to have some pages with no numbers you can either make special masters without numbers for them, or just override and delete the number frames on the live pages.
    Peter

  • Very quick and simple question about a simple sum going wrong.

    Ive noticed that im having lots of ocurrences where my maths goes wrong - usually i trace this to ints multiplying doubles and stuff , or its in degrees not radians .
    But this one is too simple to seem to cause problems :
    screenY = 180 + ( 420 - (( 420 / 2200 ) * xE ) );
    heres the code line which does the calculation, and for a particular loop it
    ran as xE = 223 .
    xE is an int by the way.
    For some reason this code always produces screenY = 600 ,
    which should only be the case if xE = 0 .
    any suggestions as to how i should help the VM get it right?
    thanks in advance guys.

    Ive noticed that im having lots of ocurrences where
    my maths goes wrong - usually i trace this to ints
    multiplying doubles and stuff , or its in degrees
    not radians .
    But this one is too simple to seem to cause problems
    screenY = 180 + ( 420 - (( 420 / 2200 ) * xE ) );
    heres the code line which does the calculation, and
    for a particular loop it
    ran as xE = 223 .
    xE is an int by the way.
    For some reason this code always produces screenY =
    600 ,
    which should only be the case if xE = 0 .It happens because in integer division 420/2200 is always equal to zero. So, regardless of the value of xE, you're adding 420 + 180, which is 600.
    any suggestions as to how i should help the VM get it right? Yes:
    double value = 180.0 + (420.0 - ((420.0/ 2200.0)*xE));
    screenY = (int)value;You can simplify all this, of course. Why not do that 420/2200 = 0.19090909... calculation once and just substitute the constant value?
    %

  • Very quick 64 Bit question..

    Hey All..
    Just set up my lovely new iMac 27" i7 and am really enjoying it. However, a friend told me that when I open Safari, Mail etc there should be the little 64 icon on them to indicate that it's running in 64 bit - is this true?
    I copied my 'user' over using a network cable from my old iMac to my new one - I was just wondering if perhaps my old 32 bit apps had copied over too. I checked it by 'get info' on safari for example and the 'open in 32 bit mode' option is unchecked - be good to have confirmation.
    I downloaded Handbrake yesterday and when I open that the little 64 icon is on it - this is what got me to thinking there is perhaps a little truth in what he has to say.
    Many thanks in advance..
    Ricky 

    RickyGray wrote:
    Hey All..
    Just set up my lovely new iMac 27" i7 and am really enjoying it. However, a friend told me that when I open Safari, Mail etc there should be the little 64 icon on them to indicate that it's running in 64 bit - is this true?
    no.
    I copied my 'user' over using a network cable from my old iMac to my new one - I was just wondering if perhaps my old 32 bit apps had copied over too.
    no, you didn't.
    I checked it by 'get info' on safari for example and the 'open in 32 bit mode' option is unchecked - be good to have confirmation.
    that means it's running in 64-bit. to make sure open Activity Monitor and see what it says in the "Kind" column for safari.
    I downloaded Handbrake yesterday and when I open that the little 64 icon is on it - this is what got me to thinking there is perhaps a little truth in what he has to say.
    Many thanks in advance..
    Ricky 

  • I purchased iphone 5 a month back... It get very hot and drained very quickly while playing games . What should i do ??

    I purchased iphone 5 a month back... It get very hot and drained very quickly while playing games . What should i do ??

    Take it in for service at your nearest Apple Store or authorized reseller.

  • Battery drains very quickly while using 3g

    My phones battery drains very quickly while using 3g service, need some suggestions or solutions to rectify it.
    Location: Bahrain
    CARRIER: Viva
    Thanks in advance

    You could also check what it draining battery under settings > power management > battery usage. Check this when you have less then 30% battery left and you should have 3G enabled from 100% battery. 
    What are your thoughts about this forum? Let us know by doing this short survey.

  • Very quick battery drain on mid 2013 macbook air please help!

    hello, my 13" macbook air is losing battery very quickly and i don't know why or what to do...
    i tried to reset the SMC and deleting all my cache files... i have closed all running applications and the battery save preferences are on default...
    I'm running OS X Mavricks and when i first installed it i did get about 14 hours of battery life with normal use, but now i only get as high as 6 hours.
    what can i do to get things back on track?
    thanks to anyone who helps!

    1. Check the cycle count of the battery against the limit for your model. The battery may be due for replacement. If the power adapter is connected almost all the time, the battery may need replacing even though the cycle count is not too high.
    2. Follow these instructions, or these for OS X 10.9 or later.
    3. In the Energy Saver preference pane, uncheck the box marked
    Enable Power Nap while on battery power
    4. You can also try resetting the SMC.
    5. Make sure your system is up to date in Software Update.
    6. Make a "Genius" appointment at an Apple Store, or go to another authorized service center.

  • How can I organise the program dashboard the way that it does not open automatically and very quickly other programs?

    How can I organise the program dashboard the way that it does not open automatically and very quickly other programs?
    Thanks for an answer
    Reinhard Voegele
    Switzerland

    If you hold down the option key while in dashboard you can close many of the programs.
    To disable it from opening automatically, or unintentionally:
    1) go to System preferences -> mission control.
    2) Deselect any mouse shortcuts
    3) Remove it from hot corners, if it is active.

  • When I try to open a picture it does open but closes very quickly and the screen displays a black border with a white circle and a ! in the middle????? Help!!! GM

    WHEN I OPEN A PICTURE FROM IPHOTO IT CLOSES VERY QUICKLY AND A BLACK BORDER WITH A WHITE CIRCLE WITH AN ! IN THE MIDDLE OF IT. WHEN IT START A SLICE SHOW THE PICTURES ARE NOT THERE. HELP!!!!

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Other than that, what version of iPhoto do you have? Assuming 09 or later try
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD
    P.S. Please don't type in block capitals. They are harder to read and on the forum it looks like you're having a tantrum

  • My iPad is a few years old but my battery is running down very quickly even when not in use? I have about 16% usage still available !

    My iPad is a few years old but the battery is running down very quickly, is there anything I can do ?

    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Battery Dying Very Quickly

    In the past week my Samsung Galaxy S3 has been dying very rapidly. Before this started my battery would last the entire day. Beginning about a week ago I noticed that after a complete charge my battery will drain to 40% or 50% after just one hour and I am not even using it but for maybe 5 minutes during that hour. The battery continues to drain very quickly so I am constantly having to charge it during the middle of the day. I also noticed that if I am using it while it is charging the battery life will not increase, whereas before it would. Also, when the battery level gets low the message to plug in your charger appears, but when I hit "okay" the message just keeps reappearing over and over. Before it would just appear every few minutes or so. I did a cache wipe a few days ago which seemed to improve it for a day, but all the issues are reappearing.
    Any ideas on what I should do?

    There have been reports of the s3 battery charge not being detected correctly, and it stopping its charge when it thinks its at 100% even if it isn't. (However it was said to be happening with International versions as opposed to US versions). Someone reported that Samsungs website recommend turning off power saving, rebooting the phone, and then charging the phone to get it to report correctly. Don't know if that will work or not, but you could try it. If you haven't already looked up battery issues on the Samgsung website give that a try.
    Samsung
    From the webpage linked pick Cell Phones, and then select your model number in the window that opens.

  • My iPad2 battery drains very quickly - why

    My iPad2's battery drains very quickly - I have removed al Notifications; On my mail set up I have selected "Off" for fetch new data - It drains even while it is in sleep mode.  I definitely don't get anywhere close to 10 hours of battery life.  What else should I be doing?

    http://www.apple.com/batteries/ipad.html
    All battery claims depend on network configuration and many other factors; actual results will vary

  • Phone heats up very quickly

    I have bought my IPhone 5 16g Last week and unfortunately I'm thinking of returning it back to apple. I found that when using the 3G function the phone heats up very quickly. But if I use wifi there is no problem.
    The lower life of the battery would be a product of the overheatin I would think.
    I Hope Apple would replace my phone. Can any one guide my how can I replace this?
    Cheers
    Suresh

    The phone heating up is definitely concerning.  Overheating can happen when processor-intensive applications are running. Maps is a good example of this.  While the phone will get fairly warm, it should not be hot to the touch.  Has anyone noticed if the overheating begins when using a specific application?  
    Here are some steps to try:
    1) Note the application that you're using when this happens. (If it's just random, skip #2)
    2) Clear the cache on that application. Settings> Applications> Manage Applications> (May have to choose All at the top)> Select
          App> Clear Cache. 
    3) Touch and hold on a blank spot on a home screen> Motorola Widgets> GPS Toggle. Turn off GPS quickly this way.
    4) If you have a live wallpaper, that may cause the device to overheat as well. 
    5) See if your software is up to date.  Settings> About phone> Android Version 2.3.X. If it's still 2.2, go to system updates at the
          top. 
    6) Last resort: Master Reset (Settings> Privacy> Factory Data Reset).
    If none of this has worked, please reply back with the following information:
    1) Temperature of the battery: Dialer> *#*#4636#*#* > Battery Information> Battery Temperature.
    2) Android Version: See step 5. 
    3) Whether or not you have tried a master reset. 
    4) If you do have Gingerbread, did it only happen after Gingerbread. 
    If something above worked, and your phone has stopped overheating, please reply back with what worked. Perhaps it will help someone else or identify a trend. 
    Thanks a lot for bringing this to our attention. 

  • IOS 8.1.3 - Battery draining very quickly

    Since installing iOS 8.1.3 on my iPhone 6 the battery has started to drain very quickly with little to no use. Anybody else having the same problem

    I too was having some serious battery drain on IOS 8.1.3 on my iPhone 5S. The phone kept getting warm (like I was using maps navigation) I think I just fixed it.  On the hunch that it had to be something with location services I went to the following location in my phones settings: Settings->Privacy->Location Services now scroll all the way down and Click System Services. Disable Cell Network Search, Setting Time Zone, and Wifi Networking. You can also try disabling these one at a time. I really don't need these services so I disabled them all.
    Your phone should now cool down and hold a charge like it did before, mine does. Here are what those settings you are disabling do:
    Cell Network Search:This tracks cell tower usage and congestion, and sends the data back to Apple for analysis as to what towers are being used the most, how you move between cell towers, and which ones are overused. It does not help your phone locate a cell tower. Turning this off will not affect your phone’s performance, according to Apple.
    Setting Time Zone:Your time zone will be instantly adjusted according to your geographic location. Ever notice how as soon as you turn on your phone after a long flight, it displays the local time perfectly, even before getting cell signal? It’s this setting. If you turn it off, you’ll lose that functionality.
    Wi-Fi Networking:This particular setting is interesting, and requires some explanation. As you move around a city, your iPhone is constantly picking up WiFi signals. It geotags that data (“XYZ WiFi is at this GPS location”), encrypts it so that it is anonymous and unique (otherwise the data would look like all hotspots are named “linksys”), and stores it as what Apple calls “crowdsourced Wi-Fi Hotspot locations”. Next time someone walks by that exact hotspot, their iPhone will know where they are without using GPS – because you basically already “marked” the area. Shutting this setting off will stop that info from being sent to Apple. It will not affect your phone’s performance.
    * The above was taken from: http://www.clear-coat.com/blog/iphone-privacy-settings/
    -Joe

Maybe you are looking for

  • Crystal report parameter usage

    Hi all, I am facing a issue in designing crystal report. I want to display records in report as per user entered value of date parameter but  in database if data is not present for given input date value then the report should run for value which is

  • Trouble Tagging/Favoriting in iMovie

    I am working on a documentary project and have too much video to put on my Macbook Pro's internal hard drive. I am using a large external hard drive, but it is having trouble with tags and favoriting/rejecting clips. Sometimes the tags/favorites disa

  • Exit for VA01 w/o contract

    Hi Experts, I am trying to find an EXIT when a user tries to create/change SO using a Expired Contract. Standard SAP shows a warning when user tried to create SO using expired contract.I need to make it an error. Thanks, Chirantan

  • Problem updating indicators

    Hi, I have a numerical indicator whose value is calculated using another control. I set up an event so that when a change of value occurs on the control, the indicator's value is recomputed. This works fine. However, I then added a second event to th

  • Qosmio G55-q802 - facial recognition problem

    Ever since I received my laptop the facial recognition program will not work. It comes up with an error and says camera device failed to initialize. Either the device is in use by another application, or it is not recognized by the system. The Toshib