Can't compile, help please!

compiler says that I haven't initialized one of the variables, but I have it entered as an integer, why won't it compile?
public class hwk5 extends JApplet {
          public void init () {
          double weight, shippingCost, rate;
          int mile, mileRate;
          String weightString, mileString;
weightString = JOptionPane.showInputDialog
          ("Enter how many pound(s) is your package weight");
     weight = Double.parseDouble(weightString);
          mileString = JOptionPane.showInputDialog
          ("Enter the total destination mile");
     mile = Integer.parseInt(mileString);
          mileRate = mile / 500;
          shippingCost = mileRate * rate;
hwk5.java:43: variable rate might not have been initialized
                    shippingCost = mileRate * rate;
^

The compiler is complaining about the fact that you haven't initialized
the 'rate' variable anywhere in your code.
kind regards,
Jos

Similar Messages

  • Tried to download us calendar.  But it stopped and won't finish downloading! Can I have help please?

    Tried to download us calendar to my iPad & iPhone.  But it stopped and won't finish downloading! Can I have help please?
    I have downloaded Japanese calendar to my calendar already.  Can't I download more than one holiday calendar?

    Plug your device into the original charger & block in a wall outlet and leave it alone for a couple of hours. Then, while it is still plugged in, restart it by holding down the home button and the power button for 10-15 seconds until you see the Apple, then let go.

  • When trying to download iTunes, I get an error message saying "the instaler encountered errors before iTunes could be configured. Errors occured during installation."  But it gives me no more information as to what I can do.  Help please?

    When trying to download iTunes, I get an error message saying "the instaler encountered errors before iTunes could be configured. Errors occured during installation."  But it gives me no more information as to what I can do.  Help please?

    Also I now can`t access any of my itunes library and am concerned that if I remove it from my computer I will lose everything as I have no option of accessing and therefore backing anything up. Any ideas?

  • TS3694 i forgot the password of my  iphone 3g and when i try to restore it it shows the message"my iphone 3g could not be restored an unknown error occurred(1015)" can any body help please..

    i forgot the password of my  iphone 3g and when i try to restore it it shows the message"my iphone 3g could not be restored an unknown error occurred(1015)" can any body help please..

    This error normally appears if you attempted to downgrade or modify your iOS. See here http://support.apple.com/kb/TS3694#error1015

  • I have a brand new i phone 4s and i have updated the soft ware to the 5.1 and tried to restore it to download my old contacts and apps etc. and my computer now wont recognise my phone and itunes will not do anything can any body help please????

    I have a brand new i phone 4s and i have updated the soft ware to the 5.1 and tried to restore it to download my old contacts and apps etc. and my computer now wont recognise my phone and itunes will not do anything can any body help please???? i need this sorting asap xxxxxxx

    see if this link helps   http://support.apple.com/kb/TS1538

  • I am trying to find a driver to syn mini mac to Lexmark x9350. Can any body help please?

    I am trying to find a driver to syn mini mac to Lexmark x9350. Can any body help please?

    Humm... the only Lexmark X9300 download that I see is for SL 10.6...?
    Lexmark United States Support & Downloads for Lexmark X9350
    I'm not sure exactly what "component missing" means, but it sounds more like a missing driver than a missing printer part? 
    To be honest, I think your going to have to remove all previous Lexmark drivers and software from your system, temporarily connect the printer up USB and use the system updater as per the link that I posted in my first reply.
    Lexmark United States
    You might also check to see if you have a failed print job..?
    Open the Print & Fax Preferences and select Open Print Queue...
    Pause the Printer using the green button.
    Select (highlight) each of the jobs in Status and Delete them all.  
    Resume Printer using the green button and send it a new job.

  • I changed my email for my apple account online and now i can't log into itunes on my iphone 5 can any one help please?

    i changed my email for my apple account online and now i can't log into itunes on my iphone 5 can any one help please?

    Sign out of your Apple ID on the device and sign in with the new credentials.

  • Hi, I have installed boot camp with wins xp home but i can't get on line with it. can only one help please.

    Hi, I have installed boot camp with wins xp home but i can't get on line with it. can only one help please.

    Please close this thread, I have managed to get a hold of a DVD including all the drivers, so I suppose that will work, if not one way then another.
    Thank you for the quick answers.

  • Reinstalled iOS 8,1.1 on grandsons iPhone 5s now wants activation gave not got one bought from new, feel as if it's my fault what can I do help please.

    HHi, My grandson was having a problem with his iPhone 5s so I said I will sort it, being a clever dick I wiped it and installed iOS 8.1.1 but now it asks for activation that I used with Apple id, I put in Apple id and password that was used but it says you can not use that email address. He bought the phone from new but can't remember any other email addresses or passwords, I feel as if it's my fault, can anybody please help me, I think iCloud was setup in case he lost the phone, but like all youngsters they can't remember anything, please help as he is so upset.
    many Thanks
    barry

    Hello Bazzamer,
    I would start with the article below to assist you with getting your grandson’s iPhone back up and running again. I will say that you will need to find out what that iCloud account is so it can be unlocked. The article will give more information as well as a link to find out what the account may be.  
    Find My iPhone Activation Lock
    http://support.apple.com/en-is/HT201365
    Regards,
    -Norm G. 

  • I have a ipod touch 3rd generation, I cant seem to get it connected to the internet, it connects to the router but not the internet ?? can any one help please?

    i recently got an ipod touch 3rd generation, i cannot seem to get it connected to the internet... it connects to the router but cannot seem to get connected to the internet, it seems to connect to the router for a very short while and then suddenly disconnect again, i have tried various solutions but cant seem to solve it, this seems to be a common problem as i have seen many complaints on other forums, many say it may be the dns server . please can any one help?

    Tap Settings / General / Reset / Reset Network Settings.
    See if that helps.
    If not try the iPod touch - Wi-Fi Troubleshooting Assistant.

  • I am New to firefox, and cant find where to click so I can save a file to favourites can any one help please

    I am trying to save Files to favourites but can not see any place on firefox where I can do this, yes there is a favourites folder there that migrated with me to firebox, but I can not add to it, can any one help please

    In Firefox favourites are called bookmarks. For details on using them see the [[bookmarks]] article.

  • How to download movies? I download as well as music, and writes that can't format. help please

    how to download movies? I download as well as music, and writes that can't format. help please

    Check the iTMS, if the movie isn't listed there, it's not for sale.

  • HT201363 This is terrible. I forgot my security questions and im trying to send an email to my rescue address and i have to answer the questions to do it!! i dont remember and theres nothing i can do someone help please! Apple support is terrible

    Please help i forgot my security questions and im trying to send an email to my rescue but to get to it i have to answer the got **** questions ! help please the support is terrible

    1. See my User Tip for some help: Some Solutions for Resetting
        Forgotten Security Questions: Apple Support Communities.
    2. Here are two different but direct methods:
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contacting Apple for
            support and service.
    3. For other queries about Apple ID see Frequently asked questions about Apple ID.
    4. Rescue email address and how to reset Apple ID security questions
    5. For online assistance use Apple - Support - Express Lane

  • Download error on PDFs--can't find helper--please help!

    Hi,
    I'm trying to use USPS.com to print labels. It used to work great for me until I downloaded the newest Firefox version and also installed the new CS3. I have Mac OS 10.5. When I go make a label at USPS (or try to download any PDF), I get an error like this and the document won't open, I can't print anything:
    Download Error
    /Users/heidinylnd/desktop/statement.pdf could not be opened, because the associated helper application does not exist. Change the association in your preferences
    I have Acrobat 8 Professional. I downloaded Acrobat Reader 8 to see if that would put the required "helper" back in place. No luck. I even made that the default program to open PDFs. I used to get "Preview" to open the PDFs, but that's not working now, either. Erg!
    Please help!
    Heidi

    I did! I had to fix it through Firefox. Apparently something doesn't install automatically with the new CS3 or 10.5--whichever is the culprit.
    Try this:
    Go to Firefox in your top menu options
    Scroll down to preferences
    When the "Main" screen comes up, click on "Content"
    Hit the last button on the page, "Manage"
    You'll then be able to see what program is linked to PDFs. On mine, no action was set once I installed the new programs and deleted my old version of Acrobat.
    I didn't fix this in Explorer, but I'll bet there's a similar process. I worked on finding the answer for 4 hours--finally getting help through firefox's volunteer forums! I even downloaded the new Acrobat reader and that didn't do anything before this.
    Hope it works for you, too!
    Heidi

  • Use itunes to restore... I CAN'T! help please

    hi.. i've been at this for hours and i can't solve anything.. while my ipod was actualizing.. all of the sudden.. the screen shows.. do not disconnect.. and it went black.. so i reseted it.. and instead of .. "working".. another screen shows up that says.. "use itunes to restore".. so i pluged it in.. and nothing happened.. nothing ricognizes it.. not itunes.. and updater says.. can't mount ipod.. what can i do??

    My Problem iz rather weird nd strange. about a month back, my 2GB nano just freezed due to no apparent reason. i used the hold-menu-and-centre-key strategy to reset it and the next screen said somthing like USE ITUNES TO RESTORE. i connected it thru my USB cable to my PC and i tunes wudn't recognize it. then i used the updater which said can't mount iPOD. i then checked ur forums and tried tht manual disk mode to format it in my PC. but on right clickin on
    iPOD(which shows as REMOVABLE DRIVE), nothing happens. no format screen iz displayed. but somehow trying again and again and restarting and shutting down the ipod service solved the matter. for testing, i copied one song with couple of photos in it. it worked reallly fine until i
    formatted my pc.
    I re-did the partitions, reinstalled the windows
    and every software. then i downloaded the latest iTUNES(7.0.2) from apple's website. ripped a few cds on my pc, then opened iTUNEs to copy more music in my iPOD. just after the copy started, iTUNES gave error which had something to do with the transfer. i unpluggged my iPOD
    after ejecting frm iTUNES and found the same freaky error (USE ITUNES TO RESTORE) again. as i had tackled thru this error earlier, so i repeated the same procedure but with latest iTUNES this time. i had to download the latest iPOD updater(1.3 i guess) too as it is not included in iTUNES.
    and after every step, it is still giving the same error over and over again. i hav another pc which iz using the same windows with previous iPOD updater and iTUNES. that updater givez errors like CAN'T MOUNT iPOD,FIRMWARE UPDATE FAILURE, etc. and also hangs sometimes. and even if it
    restores, the iPOD never restarts. when i use my other PC with newer iTUNES and new windows on it, it givez errors like UNKNOWN ERROR, etc. also after restoring, the iPOD restarts and shows the same USE ITUNES to RESTORE error. main probelm i m facing in restoring process thru disk mode iz tht whenever i right click on the iPOD in my COMPUTER, there r 99% chances that it wont show any format dialogue at all (even if the iPOD service isn't running)
    kindly help me az i m tooo much fed up of this thing. i mite smash the nano onto my computer screen if nuthin helps :S
    kindly reply soon. please note tht the country i live in doesn't giv support for iPODs and i received this product as a gift about an year back and has been working fine ever since (except last two times) also i cant afford to send it bak to UK or something like tht. so online
    help wud b much appreciated...
    also i cudnt find any POST new TOPIC button on these forums, kindly help me in tht regard too...
    THANKING IN ANTICIPATION
    P.S. i've tried it three different PCs with frsh installations. so suggest me something different also drive letter can't b changed for iPOD in disk manager..

Maybe you are looking for

  • Making PDFs Fillable - Why are they 3xs the size of the Original w/Acrobat Pro 9

    What I'm Doing: I have been creating documents out of InDesign that I export to PDF Format and then go into Acrobat 9.0 Pro to make fillable.  In Acrobat 9.0, I'll begin with a PDF that is around 1M.  Normally, once the fields are added it may increa

  • SPML webservice installation problem

    Hi, I want to install the password sync connector for AD.For that we should have the SPML web service.I have done all the steps according to the document given.Please tell me the default port number if SSL is not enabled. Our env details: OIM version

  • How do i make a slideshow lightbox with only one main image

    Hi all, i was wondering How do i make a slideshow lightbox with only one main image being seen on the page and once clicked the lightbox will open and have multiple images viewable from prev/next buttons with comments. Reason being is i want have a p

  • IBook G4 dvd drive into a MacBook Pro?

    I have a 2006 model MacBook Pro with a faulty dvd drive. My kids use this machine to play games that require a dvd player. I do have 3-4 iBook G4s in the attic just gathering dust. Is it possible to remove the dvd drive from the iBook and put into th

  • Macro not executing on opening a workbook in 2004s analyser

    Hello Everyone, I have a macro called callback in my workbook and in the workbook setting under the exits tabs I have checked "Run macro on refresh " option with callback as the macro. The macro is not being executed automatically on opening the work