Just wanted to know weather the Infinite loop Is proper?

hi, I wrote an infinite loop.here's the code
import acm.program.*;
public class myFirstInfiniteLoop extends DialogProgram{
public void run() {
int x=0;     
     while (x<=0){
println("this just might be an Infinite loop.");
break;
println("were out of the Infinit loop");
  just wanted to know weather the code would function properly.
Thanks! :D

Parastar wrote:
When I tried It the dialog box first came up with the text "this just might be an infinite loop" after clicking okay the second dialog box came up stating "were out of the Infinite loop"Do you understand why?
now If I removed the break; form the while loop the dialog box's keep on coming even after I pressed okay,does that mean the infinite loop Is coded well?What is your guess here?
And just as a side note: And infinite loop is easily implemented using "while(+expression+) { ... your code ...}" where "+expression+" evaluates to true. You are using "x>=0" as the expression. There is a much simpler expression around, that always evaluates to true: it's simply "true". This way you don't need the variable x.

Similar Messages

  • I am thinking of upgrading my Macbook pro software to Mountain lion, and I just wanted to know if the airplay function is really all its cracked up to be?

    I am thinking of upgrading my Macbook pro software to Mountain lion, and I just wanted to know if the airplay function is really all its cracked up to be?
    For example can I stream videos from VLC to my apple tv?
    Thanks team!!
    R

    Your question asked.....
    Can either of these three connect to the existing router (which is not an Apple router and cannot be changed) wireless?
    So we understood that you wanted to connect to the existing router using wireless.
    If you can run an Ethernet cable from one of the LAN <-> ports on your existing router to the other house, then you could connect one of the Apple routers that way.
    Compare the Apple routers here to find one that might meet your requirements:
    http://www.apple.com/compare-wifi-models/

  • I just want to know if the earphone for mini iPad is different from the regular one

    I just want to know if the earphone for mini iPad is different from the other earphone

    No, it is a standard 3.5mm jack.

  • I just want to know when the new ipod touch 5th generation will come out

    i just want to know when the new ipod touch 5th generation will come out

    Apple has not announced any new iPod models. When they do, we'll all find out at the same time, I would guess, since the announcement will be prominent on every Apple-related web site and will probalby be posted in multiple threads in these forums.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base before you post a question.
    Regards.

  • My ePrint works fine. Just want to know if the printer will spool the picture if the printer is off

    Will my 1 day old HP Envy spool an incoming picture if the printer is off.  If I am waiting for  an incoming picture,  should the printer be on or will it be stored in memory.

    HI,
    If the printer is really turned of the server will keep the picture in its memory for 24 hours and then print it after its tured on again. After 24 hours the picture is deleted from the server and has to be resend.
    Say "Thanks" by clicking the Kudos Star in the post that helped you.
    Although I work for HP my posts and replies are my own
    Please mark the post that solves your problem as "Accepted Solution"

  • I just want to know how to save some of the music manuscript i have created under songwriting, in to a format that I can email to a non-apple PC so that they can print it for me. How

    I just want to know how to save some of the music manuscript i have created under songwriting, in to a format that I can email to a non-apple PC so that they can print it for me. How would I do that?
    Thank you,
    Peter Michaels.

    And you just like helping people?
      That is just the way this forum works - users get help from other users and learn from others and like to contribute if they see they can help.
    My latest challenge was typing in melodies and chords of songs I'd written on the piano. But using the Musical Typing in register C3 I inserted all the notes by playing on the imac keyboard (and written in the treble clef). The only problem is you cant insert the chords at the same time. Now I have an empty bass clef, which requires chords be inserted in register C2 and I dont know yet how to do that.
    To fill in the chords: Join a melody track and a bass track, like this:
    - Create a new software track and record the chords separately with musical typing.
    - Create a new track and copy your melody loops there (just as backup, if something goes wrong)
    - Do the same with the track containing the chords.
    - Then select all loops in the copies of the melody track  and the copy of the chords track and select from the main menu
           Edit -> Join.
    Now you should have a track that contains the bass as well as the melody and both staffs should be filled in the track editor, so you can print both at the same time.
    However, there will be some notes assigned to the wrong staff - very low melody notes will appear in the bass cleff, very high chord notes will appear in the melody cleff - and I don't see how you could fix that in GB.
    Good luck
    Léonie

  • I dropped my ipod5 on a stone table (really hard) and the color (little part) came off! It's not a big problem but I just got it not long time ago. Can Apple repaire it? Will it be free? P.s. That part it's like 1mmX1mm not big, but I just want to know.

    Like I say I'm the title... A little part "colour" on my iPod5 came off after I dropped my iPod on a stone table.
    I just want to know that can Apple repair it or it doesn't count on the guarantee? It's not a big problem but I just got it few month ago...It's brand new! Do that's why I'm curious..:) and if they can repair... Will it gonna be free?

    When you get your iPod repaired / replaced... do yourself a favor, spend a few more bucks and but a case, like a Lifeproof or Griffin Survivor. Both cover the entire iPod and offer protection against drops and falls, weather, sand, dust, etc. and will at least minimize if not prevent damage to your iPod.  Good luck.

  • I'm visiting new York(USA) for work on Sunday, just wanted to know if i can buy an un locked iphone from the apple store or not, since i'm not a resident, to the record we don't have an apple store at my country

    I'm visiting new York(USA) for work on Sunday, just wanted to know if i can buy an un locked iphone from the apple store or not, since i'm not a resident, to the record we don't have an apple store at my country.

    You can buy an unlocked iPhone at any of the 5 Apple stores in NYC. All are open on Sunday. Note a couple of things, however:
    US iPhone 5's will work on 3G in the rest of the world, but not on LTE because the US phones use different channels than other countries
    Be sure you say "unlocked", not "no contract"
    If it breaks it must be returned to a US store for repair, and if shipped to Apple it must be from and to a US address

  • On my iPhone when I go on phone to view my contacts on the top left corner there is a circle with a arrow ( like a refresh icon ), just want to know what is it?

    On my iPhone when I go on phone to view my contacts on the top left corner there is a circle with a arrow ( like a refresh icon ), just want to know what is it?

    That's exactly what it does, refresh your contacts. As an example if you add a contact on your Mac or iPad and you use iCloud to sync them altogether, then this can be used to refresh the contacts on your iPhone. 

  • I have an iPod nano 1st gen. my system operative is windows vista . I just want to transfer all the music of my iPod to iTunes library like I was able to do it in the past I don't know what have change?

    I have an iPod nano 1st gen. my system operative is windows vista . I just want to transfer all the music of my iPod to iTunes library like I was able to do it in the past I don't know what have change?

    Thank you deggie to answer me . You know, I don't know much of computers and of technology but when I bought that ipod back when  they came out 2005 I was able to download music from my CDs and from Youtube to itunes then transfer to my ipod and back and forth to itunes .  Then if I had changed of computer I was able to transfer to that new computer.Why I'm not able to do it ? There is a program(Sharepod) that allow to do that but it cost $35.00 but I thought that was free or it is because that now I have to buy from itunes only?

  • I just want to know that if I buy an iphone 4S here in melbourne can i use it in china? i don`t know whether it`s locked or not and i don`t know what`s the network in china as well. Can somebody please help?I am really in a hurry to know it. Thanks a lot.

    I just want to know that if I buy an iphone 4S here in melbourne can i use it in china?
    i don`t know whether it`s locked or not and i don`t know what`s the network in china as well.
    Can somebody please help?
    I am really in a hurry to know it.
    Thanks a lot.
    P.S: For the iphone 4S. is there any difference for the one from online shop or the actual store?

    iPhones purchased from the online Apple Store in Australia will be unlocked. To the best of my knowledge, unlocked iPhone are not available from the physical Apple Stores at this time, though you can call the Apple Store in Melbourne and inquire.
    Note that the warranty on iPhones is not international, so if you purchase an iPhone in Australia and it needs service, you would have to ship the iPhone to someone in Australia to take or send to Apple for service and then ship it back to you.
    Regards.
    (Note for any readers: this is an old thread and I posted before noticing the date, but decided to leave my reply in case anyone else finds the thread and has the same question).

  • HT4528 How can I see if a picture was sent from my phone? I am not sure the number it was sent to, it may have been an i-phone. I just want to know if someone sent themselves a pic from my phone....

    How can I see if a picture was sent from my iPhone? I am not sure the number the picture(s) was sent to..and whether or not it was an iPhone...I just want to know if someone sent themselves pics from my phone. Aside from a court order to obtain data message info, any ideas? Any info is greatly appreciated.

    by email?
    by mms?

  • I have just purchased a new iphone 5, just wanted to know that what is the best way to insure my iphone

    i have just purchased a new iphone 5, just wanted to know that what is the best way to insure my iphone

    Contact yor carrier. Your carrier may have some Mobile Insurance that you pay a certain amount per month to insure your device. Most carriers require you have the device less than 30 days in order to insure it. If your carrier is AT&T, AT&T has mobile insurance for only $6.99 per month. AT&T has open enrollment for their mobile insurance now. So anyone has an AT&T line can get insurance coverage for their device.

  • Hi, my name is Laith I'm from Iraq I just want to know what are the steps for buying a new iphone 5 from apple store and how to ship it to Iraq ???? and I would be grateful for you

    hi, my name is Laith I'm from Iraq I just want to know what are the steps for buying a new iphone 5 from apple store and how to ship it to Iraq ???? and I would be grateful for you

    Legality aside (I'm not a lawyer and have no opinion on the matter) in order to make a purchase of an iPhone 5 you would need to travel to a country where they are for sale and purchase it there. Be sure to get one that is officially unlocked or you would not be able to use it with your cell carrier. Be sure that your carrier supports use of the iPhone before you buy. Also note that the warranty of the iPhone is only valid in the country of purchase.
    Appe does not ship outside of the countries where it sells the phones.

  • HT2688 I just want to know where to find the shared libraries on the new iTunes. These articles are a million years old, and are of no help.

    I just want to know where to find my shared libraries on the stupid new iTunes. The layout was fine before, but when they changed it, I can't seem to find them. The articles on Apple are a million years old, before the latest iTunes update, so they are no help. Thanks.

    carlygo wrote:
    The articles on Apple are a million years old, before the latest iTunes update, so they are no help. Thanks.
    It's only 7 months old and it is still correct.
    ctrl B = Show sidebar.
    ctrl S = Show menu.

Maybe you are looking for

  • O/P Type in case of return delivery

    Hi, In our present system if in case there is some rejection of material we are rejecting the material and making return delivery with MBRL by entrering the GR number and Fusacal year and we are getting the print out but i want to know which o/p type

  • Payment Wizard Skips Payments

    Hello Guys, I have this challenge that I really need someone's help to overcome.When the Payment Wizard is used to execute a payment run,about 70% of included transactions do not get executed, I do not get any error messages too, the invoices just do

  • Itunes library is gone

    When I tryed to sync my Ipod, nothing happened. So I unpluged my Ipod and rebooted the system. Now I have no music library and no playlists etc. My Ipod is frozen on the do not disconnect screen. I think I really screwed something up here. Can anyone

  • Previous month end data for report

    Hi expert, I have to calculate previous month end data for my report. let say if user select 15 oct then he should be able to see 30 sept data. I have calander prompt. Thanks,

  • Wifi problem - connection stalls. MSI GE620DX

    Hi, Bought this laptop May 2011. OS Windows 7 Home Premium, Intel Centrino Wireless-N 130 wifi adapter (from Windows device manager). I have had the same Wifi problem from the beginning. The Wifi connection stalls every 5-20 seconds or so. The wifi s