I dont understand why i get this error when trying to type "else"

Hello Everybody,
Im new to java and am writing a simple program which gets a input number between 0 and 100 and is to print A for (grade>=90), B for (90>grade>=80) and so on, when grades < 60 get F.
i use a series of if/else, but when i get to the FINAL else it gets an error (red wavy line under the last else). this ruins the program bcoz now a grade 61 will output "D" AND "F".
can anyone explaing why this error msg? and how can i fix it?
this is the code:
public class Assignment02Q04 {
     public static void main (String[] args){
          int grade = (Integer.parseInt(args[0]));
          if (grade >= 90){
               System.out.println("A");}
                    else {if (grade >= 80){
                    System.out.println("B");}
                         else {if (grade >= 70){
                         System.out.println("C");}
                         else {if (grade >=60);{
                              System.out.println("D");}
                         else System.out.print("F");
     }

Please ignore the rude bits... this is a pro-forma post most often trotted out to suspected trolls... i.e. It's NOT directed at you personally.
h1. The Ubiquitous Newbie Tips
* DON'T SHOUT!!!
* Homework dumps will be flamed mercilessly.
* Have a quick scan through the [Forum FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ].
h5. Ask a good question
* Don't forget to actually ask a question. No, The subject line doesn't count.
* Ask once
    - Don't Crosspost!
    - Two people answering one question independantly is a waste of there time.
* Don't even talk to me until you've:
    (a) [googled it|http://www.google.com.au/] and
    (b) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
    (c) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
    (d) referred to the JLS (for "advanced" questions).
* [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
    - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
      - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
    - Often you discover your own mistake whilst forming a "Good question".
    - Many of the regulars on these forums will bend over backwards to help with a "Good question",
      especially to a nuggetty problem, because they're interested in the answer.
* Improve your chances of getting laid tonight by writing an SSCCE
    - For you normal people, That's a: Short Self-Contained Compilable Example.
    - Short is sweet: No-one wants to wade through 5000 lines to find your syntax errors!
    - Often you discover your own mistake whilst writing an SSCCE.
    - Solving your own problem yields a sense of accomplishment ;-)
h5. Formatting Matters
* Post your code between a pair of &#123;code} tags
    - That is: &#123;code} ... your code goes here ... &#123;code}
    - This makes your code easier to read by preserving whitespace and highlighting java syntax.
    - Copy&paste your source code directly from your editor. The forum editor basically sucks.
    - The forums tabwidth is 8, as per [the java coding conventions|http://java.sun.com/docs/codeconv/].
      - Indents will go jagged if your tabwidth!=8 and you've mixed tabs and spaces.
      - Lines longer than 80 characters should be wrapped.
      - Proper indentation illustrates program logic.
* Post your error messages between a pair of &#123;code} tags:
    - That is: &#123;code} ... errors here ... &#123;code}
    - To make it easier for us to find, Mark the erroneous line(s) in your source-code. For example:
        System.out.println("Your momma!); // <<<< ERROR 1
    - Note that error messages are rendered basically useless if the code has been
      modified AT ALL since the error message was produced.
    - Here's [How to read a stacktrace|http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/].
* The forum editor has a "Preview" pane. Use it.
    - If you're new around here you'll probably find the "Rich Text" view is easier to use.
    - WARNING: Swapping from "Plain Text" view to "Rich Text" scrambles the markup!
    - To see how a posted "special effect" is done, click reply then click the quote button.
If you (the newbie) have covered these bases *you deserve, and can therefore expect, GOOD answers!*
h1. The pledge!
We the New To Java regulars do hereby pledge to refrain from flaming anybody, no matter how gumbyish the question, if the OP has demonstrably tried to cover these bases. The rest are fair game.
Edited by: corlettk on 17/03/2009 23:25 ~~ Doh!

Similar Messages

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • I get this error when trying to run iCloud- Error: 0x80040604: Up/POST:Conflicts

    Why do I always get this error when trying to upload Outlook data to iCloud (Win 7 & Outlook 2007) Error: 0x80040604: Up/POST:Conflicts???
    I have deleted an reinstalled iCloud and still can't get past the error.

    have you seen this KB article: http://support.apple.com/kb/HT1398 ?
    JGG

  • I keep getting this error when trying to backup time capsule with time machine. The backup disk image "/Volumes/Data-1/Dan's iMac.sparsebundle" is already in use.

    I keep getting this error when trying to backup time capsule with time machine. The backup disk image “/Volumes/Data-1/Dan’s iMac.sparsebundle” is already in use.

    Make sure that no other Macs are backing up at the time.
    Pull the power cable from the back of the Time Capsule
    Count to ten
    Plug the power cable back into the back of the Tme Capsule
    Wait a few minutes, then try a backup again.

  • I get this error when trying to create a ringtone - iTunes could not connec

    I get this error when trying to create a ringtone:
    "iTunes could not connect to the iTunes Store - an unknown error occurred (11556)"
    But I CAN connect - if I click on the iTunes Store, it connects right away.
    I want to make a ringtone from a song that I purchased, but all I get is the same error message.
    iTunes 9.2.2, Ireland iTunes Store.

    have you seen this KB article: http://support.apple.com/kb/HT1398 ?
    JGG

  • There was an error installing this update. Please quit and try again later. Error Code: U44M1I210  I keep getting this error when trying to update

    There was an error installing this update. Please quit and try again later. Error Code: U44M1I210  I keep getting this error when trying to update

    Hi,
    You can visit Error U44M1I210 | Install updates and see if it works.
    Regards
    Kishan

  • Can anyone tell me why I'm getting this error when trying to make visibility variables

    I have set these up in previous versions of Illustrator. CS and illustrator 10 worked just fine with Variables. Now I can't seem to switch between data sets. I just keep getting this error when I try to switch from one data set to another.

    I'll start with the permissions and see if it changes the behavior.

  • Keep getting this error when trying to skype... i ...

    http://puu.sh/cTXLk/0df5219d2f.png - keep getting this error. i tried downgrading from 6.2 to 6.1 and still getting it....

    Make sure that no other Macs are backing up at the time.
    Pull the power cable from the back of the Time Capsule
    Count to ten
    Plug the power cable back into the back of the Tme Capsule
    Wait a few minutes, then try a backup again.

  • I get this error when trying to compile a plain C++ project

    Tool:0: Couldn't run '/usr/bin/gcc-3.3' because it does not refer to an accessible executable.
    I get this error when I try to compile/build a normal C++ project.
    I make a new project. C++ tool. Call it "test"
    It automatically makes a main.cpp file which should output "hello world" but instead I get that error above. Not sure what is going on.

    I'm not sure where the "verbose" icon is, but I did get this, if it helps
    Native Build of Target "Test" using Build Style "Development"
    CompileC build/Test.build/Test.build/Objects-normal/ppc/main.o main.cpp normal ppc c++ com.apple.compilers.gcc.3_3
    cd /Users/Eric/Documents/Test
    /usr/bin/gcc-3.3 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -ffix-and-continue -mtune=G5 -Wp,-header-mapfile,/Users/Eric/Documents/Test/build/Test.build/Test.build/Test .hmap -F/Users/Eric/Documents/Test/build -I/Users/Eric/Documents/Test/build/include -I/Users/Eric/Documents/Test/build/Test.build/Test.build/DerivedSources -c /Users/Eric/Documents/Test/main.cpp -o /Users/Eric/Documents/Test/build/Test.build/Test.build/Objects-normal/ppc/main. o
    And my version of Xcode and such is..
    Xcode 2.0
    Xcode IDE 514.0
    Xcode Core 515.0
    ToolSupport 514.0
    Not sure about the SDK.
    iBook G4 and iPod Mini Mac OS X (10.4.5)

  • Why am I getting this error when trying to do Image Processor?

    Ok I am using Bridge & Image Processor to add a water mark to multiple photos at a time with my ready made action.  But for some reason I seem to be getting this error message every few pictures?
    I've never had problems with other photo sets doing this before, but it was just recently that it started.
    But it will successfully add the water mark to some of them via the Image Processor

    Actually, my DVD multi-drives are I:\ and J:\, as my C:\ thru H:\ drives are my individual internal HDD's. Even on my laptop, my multi-drive is F:\. I always list my internals in order, and my multi-drives afterwards. In my case, it's simple layout for simple minds. I am also keen on having my internals listed at the hardware level as 0 = C:\, 1 = D:\, 2 = E:\, 3 = F:\ and so on. Once let a builder deviate from this order and it bit me big time - never again!
    Now, you are possibly correct that the D:\ might be the OP's D:\ is the multi-drive, and now some source disc is not in it. To keep this sort of thing from happening, I ALWAYS Copy my Assets to an internal from my externals (usually), my NAS, and from any archive discs. Importing/Opening from a DVD/CD is often asking for trouble.
    Good luck to the OP,
    Hunt

  • Getting this error when trying to run latest software update on MacBook Pro

    Everytime I try to run the update, it starts to download and then I get this error:
    The operation couldn’t be completed. (NSURLErrorDomain error -1102.)(102)
    I'm not too sure what it means, or how to fix it. If someone could help me out, that would be great!
    Thanks!

    You might try this:
    Repair the Hard Drive and Permissions - Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Then download and install: OS X Mountain Lion Update v10.8.5 (Combo).

  • HT1222 Hi all, im getting this error when trying to update.

    I'm trying to install the new update, but keep getting this error message,( INSURLError Domain error - 3001 ) (102)
    can anyone help

    If this error is for the Safari 6.0.2 update, try this discussion link to manually download it.

  • Getting this error when trying to upgrade...

    I'm getting this message when I try and upgrade my iTunes...I don't know how to fix this or what I did to have it do this.
    http://img.photobucket.com/albums/v20/kody1234/CaptureItunes.jpg
    "The feature you are trying to use is on a network resource that is unavailable.
    Click OK to try again, or enter an alternate path to a folder containing the installation package, "iTunes64.msi" in the box below."

    Click OK to try again, or enter an alternate path to a folder containing the installation package, "iTunes64.msi" in the box below
    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • In iPhoto, I am getting this error when trying to email a photo.  "The email server didn't recognize your username/password combination."

    I am trying to email a photo from iphoto using my gmail account.  I am receiving this error that my email server doesn't recognize my username/password.  I do have a different password for Gmail, should that matter?  How can I correct this?

    in the iPhoto preferences ==> accounts delete your e-mail account and reenter it
    OR
    IMHO the better solution is to set Apple mail as the email client in the iPhoto preferences
    LN

  • I get this error when trying to download 10.5

    What is the cause of this error message?
    The webpage at https://swdlp.apple.com/cgi-bin/WebObjects/SoftwareDownloadApp.woa/wa/getProduct Data?localang=en_us

    Dgennetten please try completing the following steps:
    Please locate and rename the C:\Program Files (x86)\Common Files\Adobe\OOBE folder to OOBE_OLD
    Reinstall the Adobe Creative Cloud Application from https://creative.adobe.com/products/creative-cloud.
    Dgennetten is there a specific case number which I should review in reference to the BUILD conference you attended?  At the moment I am only using the information which is available within this discussion.

Maybe you are looking for