Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 3 of 3 FirstFirst 123
Results 51 to 64 of 64

Thread: Java Programming project

  1. #51
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    really? ok
    Muffler.java:48: error: cannot find symbol
    switch(price) {
    ^
    symbol: variable price
    location: class Muffler
    Muffler.java:50: error: cannot find symbol
    case(A): cost = priceCost * 1.00;
    ^
    symbol: variable A
    location: class Muffler
    Muffler.java:50: error: illegal start of type
    case(A): cost = priceCost * 1.00;
    ^
    Muffler.java:52: error: cannot find symbol
    case(A3): cost = priceCost * 41.95;
    ^
    symbol: variable A3
    location: class Muffler
    Muffler.java:52: error: illegal start of type
    case(A3): cost = priceCost * 41.95;
    ^
    Muffler.java:54: error: cannot find symbol
    case(B): cost = priceCost * 1.07;
    ^
    symbol: variable B
    location: class Muffler
    Muffler.java:54: error: illegal start of type
    case(B): cost = priceCost * 1.07;
    ^
    Muffler.java:56: error: cannot find symbol
    case(B3): cost = priceCost * 44.89;
    ^
    symbol: variable B3
    location: class Muffler
    Muffler.java:56: error: illegal start of type
    case(B3): cost = priceCost * 44.89;
    ^
    Muffler.java:58: error: cannot find symbol
    case(BL): cost = priceCost * 48.10;
    ^
    symbol: variable BL
    location: class Muffler
    Muffler.java:58: error: illegal start of type
    case(BL): cost = priceCost * 48.10;
    ^
    Muffler.java:60: error: cannot find symbol
    case(C): cost = priceCost * 1.15;
    ^
    symbol: variable C
    location: class Muffler
    Muffler.java:60: error: illegal start of type
    case(C): cost = priceCost * 1.15;
    ^
    Muffler.java:62: error: cannot find symbol
    case(C3): cost = priceCost * 48.24;
    ^
    symbol: variable C3
    location: class Muffler
    Muffler.java:62: error: illegal start of type
    case(C3): cost = priceCost * 48.24;
    ^
    Muffler.java:64: error: cannot find symbol
    case(CL): cost = priceCost * 51.69;
    ^
    symbol: variable CL
    location: class Muffler
    Muffler.java:64: error: illegal start of type
    case(CL): cost = priceCost * 51.69;
    ^
    Muffler.java:66: error: cannot find symbol
    case(D): cost = priceCost * 1.22;
    ^
    symbol: variable D
    location: class Muffler
    Muffler.java:66: error: illegal start of type
    case(D): cost = priceCost * 1.22;
    ^
    Muffler.java:68: error: cannot find symbol
    case(D3): cost = priceCost * 51.18;
    ^
    symbol: variable D3
    location: class Muffler
    Muffler.java:68: error: illegal start of type
    case(D3): cost = priceCost * 51.18;
    ^
    Muffler.java:70: error: cannot find symbol
    case(DL): cost = priceCost * 54.84;
    ^
    symbol: variable DL
    location: class Muffler
    Muffler.java:70: error: illegal start of type
    case(DL): cost = priceCost * 54.84;
    ^
    Muffler.java:72: error: cannot find symbol
    case(E): cost = priceCost * 1.38;
    ^
    symbol: variable E
    location: class Muffler
    Muffler.java:72: error: illegal start of type
    case(E): cost = priceCost * 1.38;
    ^
    Muffler.java:74: error: cannot find symbol
    case(E3): cost = priceCost * 57.89;
    ^
    symbol: variable E3
    location: class Muffler
    Muffler.java:74: error: illegal start of type
    case(E3): cost = priceCost * 57.89;
    ^
    Muffler.java:76: error: cannot find symbol
    case(EL): cost = priceCost * 62.03;
    ^
    symbol: variable EL
    location: class Muffler
    Muffler.java:76: error: illegal start of type
    case(EL): cost = priceCost * 62.03;
    ^
    Muffler.java:78: error: cannot find symbol
    case(F3): cost = priceCost * 62.92;
    ^
    symbol: variable F3
    location: class Muffler
    Muffler.java:78: error: illegal start of type
    case(F3): cost = priceCost * 62.92;
    ^
    Muffler.java:80: error: cannot find symbol
    case(FL): cost = priceCost * 67.42;
    ^
    symbol: variable FL
    location: class Muffler
    Muffler.java:80: error: illegal start of type
    case(FL): cost = priceCost * 67.42;
    ^
    Muffler.java:83: error: cannot find symbol
    if(priceCode.length(x>1))
    ^
    symbol: variable x
    location: class Muffler
    Muffler.java:86: error: array required, but String found
    if(priceCode [1] == ("3"))
    ^
    Muffler.java:90: error: array required, but String found
    else if(priceCode [1]==("L"))
    ^
    36 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete
    I don't get why i have 36 errors now. I had 1 error before.

    --- Update ---

    really? ok
    Muffler.java:48: error: cannot find symbol
    switch(price) {
    ^
    symbol: variable price
    location: class Muffler
    Muffler.java:50: error: cannot find symbol
    case(A): cost = priceCost * 1.00;
    ^
    symbol: variable A
    location: class Muffler
    Muffler.java:50: error: illegal start of type
    case(A): cost = priceCost * 1.00;
    ^
    Muffler.java:52: error: cannot find symbol
    case(A3): cost = priceCost * 41.95;
    ^
    symbol: variable A3
    location: class Muffler
    Muffler.java:52: error: illegal start of type
    case(A3): cost = priceCost * 41.95;
    ^
    Muffler.java:54: error: cannot find symbol
    case(B): cost = priceCost * 1.07;
    ^
    symbol: variable B
    location: class Muffler
    Muffler.java:54: error: illegal start of type
    case(B): cost = priceCost * 1.07;
    ^
    Muffler.java:56: error: cannot find symbol
    case(B3): cost = priceCost * 44.89;
    ^
    symbol: variable B3
    location: class Muffler
    Muffler.java:56: error: illegal start of type
    case(B3): cost = priceCost * 44.89;
    ^
    Muffler.java:58: error: cannot find symbol
    case(BL): cost = priceCost * 48.10;
    ^
    symbol: variable BL
    location: class Muffler
    Muffler.java:58: error: illegal start of type
    case(BL): cost = priceCost * 48.10;
    ^
    Muffler.java:60: error: cannot find symbol
    case(C): cost = priceCost * 1.15;
    ^
    symbol: variable C
    location: class Muffler
    Muffler.java:60: error: illegal start of type
    case(C): cost = priceCost * 1.15;
    ^
    Muffler.java:62: error: cannot find symbol
    case(C3): cost = priceCost * 48.24;
    ^
    symbol: variable C3
    location: class Muffler
    Muffler.java:62: error: illegal start of type
    case(C3): cost = priceCost * 48.24;
    ^
    Muffler.java:64: error: cannot find symbol
    case(CL): cost = priceCost * 51.69;
    ^
    symbol: variable CL
    location: class Muffler
    Muffler.java:64: error: illegal start of type
    case(CL): cost = priceCost * 51.69;
    ^
    Muffler.java:66: error: cannot find symbol
    case(D): cost = priceCost * 1.22;
    ^
    symbol: variable D
    location: class Muffler
    Muffler.java:66: error: illegal start of type
    case(D): cost = priceCost * 1.22;
    ^
    Muffler.java:68: error: cannot find symbol
    case(D3): cost = priceCost * 51.18;
    ^
    symbol: variable D3
    location: class Muffler
    Muffler.java:68: error: illegal start of type
    case(D3): cost = priceCost * 51.18;
    ^
    Muffler.java:70: error: cannot find symbol
    case(DL): cost = priceCost * 54.84;
    ^
    symbol: variable DL
    location: class Muffler
    Muffler.java:70: error: illegal start of type
    case(DL): cost = priceCost * 54.84;
    ^
    Muffler.java:72: error: cannot find symbol
    case(E): cost = priceCost * 1.38;
    ^
    symbol: variable E
    location: class Muffler
    Muffler.java:72: error: illegal start of type
    case(E): cost = priceCost * 1.38;
    ^
    Muffler.java:74: error: cannot find symbol
    case(E3): cost = priceCost * 57.89;
    ^
    symbol: variable E3
    location: class Muffler
    Muffler.java:74: error: illegal start of type
    case(E3): cost = priceCost * 57.89;
    ^
    Muffler.java:76: error: cannot find symbol
    case(EL): cost = priceCost * 62.03;
    ^
    symbol: variable EL
    location: class Muffler
    Muffler.java:76: error: illegal start of type
    case(EL): cost = priceCost * 62.03;
    ^
    Muffler.java:78: error: cannot find symbol
    case(F3): cost = priceCost * 62.92;
    ^
    symbol: variable F3
    location: class Muffler
    Muffler.java:78: error: illegal start of type
    case(F3): cost = priceCost * 62.92;
    ^
    Muffler.java:80: error: cannot find symbol
    case(FL): cost = priceCost * 67.42;
    ^
    symbol: variable FL
    location: class Muffler
    Muffler.java:80: error: illegal start of type
    case(FL): cost = priceCost * 67.42;
    ^
    Muffler.java:83: error: cannot find symbol
    if(priceCode.length(x>1))
    ^
    symbol: variable x
    location: class Muffler
    Muffler.java:86: error: array required, but String found
    if(priceCode [1] == ("3"))
    ^
    Muffler.java:90: error: array required, but String found
    else if(priceCode [1]==("L"))
    ^
    36 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete
    I don't get why i have 36 errors now. I had 1 error before.

    --- Update ---

    really? ok
    Muffler.java:48: error: cannot find symbol
    switch(price) {
    ^
    symbol: variable price
    location: class Muffler
    Muffler.java:50: error: cannot find symbol
    case(A): cost = priceCost * 1.00;
    ^
    symbol: variable A
    location: class Muffler
    Muffler.java:50: error: illegal start of type
    case(A): cost = priceCost * 1.00;
    ^
    Muffler.java:52: error: cannot find symbol
    case(A3): cost = priceCost * 41.95;
    ^
    symbol: variable A3
    location: class Muffler
    Muffler.java:52: error: illegal start of type
    case(A3): cost = priceCost * 41.95;
    ^
    Muffler.java:54: error: cannot find symbol
    case(B): cost = priceCost * 1.07;
    ^
    symbol: variable B
    location: class Muffler
    Muffler.java:54: error: illegal start of type
    case(B): cost = priceCost * 1.07;
    ^
    Muffler.java:56: error: cannot find symbol
    case(B3): cost = priceCost * 44.89;
    ^
    symbol: variable B3
    location: class Muffler
    Muffler.java:56: error: illegal start of type
    case(B3): cost = priceCost * 44.89;
    ^
    Muffler.java:58: error: cannot find symbol
    case(BL): cost = priceCost * 48.10;
    ^
    symbol: variable BL
    location: class Muffler
    Muffler.java:58: error: illegal start of type
    case(BL): cost = priceCost * 48.10;
    ^
    Muffler.java:60: error: cannot find symbol
    case(C): cost = priceCost * 1.15;
    ^
    symbol: variable C
    location: class Muffler
    Muffler.java:60: error: illegal start of type
    case(C): cost = priceCost * 1.15;
    ^
    Muffler.java:62: error: cannot find symbol
    case(C3): cost = priceCost * 48.24;
    ^
    symbol: variable C3
    location: class Muffler
    Muffler.java:62: error: illegal start of type
    case(C3): cost = priceCost * 48.24;
    ^
    Muffler.java:64: error: cannot find symbol
    case(CL): cost = priceCost * 51.69;
    ^
    symbol: variable CL
    location: class Muffler
    Muffler.java:64: error: illegal start of type
    case(CL): cost = priceCost * 51.69;
    ^
    Muffler.java:66: error: cannot find symbol
    case(D): cost = priceCost * 1.22;
    ^
    symbol: variable D
    location: class Muffler
    Muffler.java:66: error: illegal start of type
    case(D): cost = priceCost * 1.22;
    ^
    Muffler.java:68: error: cannot find symbol
    case(D3): cost = priceCost * 51.18;
    ^
    symbol: variable D3
    location: class Muffler
    Muffler.java:68: error: illegal start of type
    case(D3): cost = priceCost * 51.18;
    ^
    Muffler.java:70: error: cannot find symbol
    case(DL): cost = priceCost * 54.84;
    ^
    symbol: variable DL
    location: class Muffler
    Muffler.java:70: error: illegal start of type
    case(DL): cost = priceCost * 54.84;
    ^
    Muffler.java:72: error: cannot find symbol
    case(E): cost = priceCost * 1.38;
    ^
    symbol: variable E
    location: class Muffler
    Muffler.java:72: error: illegal start of type
    case(E): cost = priceCost * 1.38;
    ^
    Muffler.java:74: error: cannot find symbol
    case(E3): cost = priceCost * 57.89;
    ^
    symbol: variable E3
    location: class Muffler
    Muffler.java:74: error: illegal start of type
    case(E3): cost = priceCost * 57.89;
    ^
    Muffler.java:76: error: cannot find symbol
    case(EL): cost = priceCost * 62.03;
    ^
    symbol: variable EL
    location: class Muffler
    Muffler.java:76: error: illegal start of type
    case(EL): cost = priceCost * 62.03;
    ^
    Muffler.java:78: error: cannot find symbol
    case(F3): cost = priceCost * 62.92;
    ^
    symbol: variable F3
    location: class Muffler
    Muffler.java:78: error: illegal start of type
    case(F3): cost = priceCost * 62.92;
    ^
    Muffler.java:80: error: cannot find symbol
    case(FL): cost = priceCost * 67.42;
    ^
    symbol: variable FL
    location: class Muffler
    Muffler.java:80: error: illegal start of type
    case(FL): cost = priceCost * 67.42;
    ^
    Muffler.java:83: error: cannot find symbol
    if(priceCode.length(x>1))
    ^
    symbol: variable x
    location: class Muffler
    Muffler.java:86: error: array required, but String found
    if(priceCode [1] == ("3"))
    ^
    Muffler.java:90: error: array required, but String found
    else if(priceCode [1]==("L"))
    ^
    36 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete
    I don't get why i have 36 errors now. I had 1 error before.

  2. #52
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    cannot find symbol
    The compiler can not find a definition for the symbol or variable named in the error message.
    All variables used in a program MUST be defined so the compiler knows what type they are.

    Many of the "variables" that are not defined in the program look like they should be String literals.
    A String literal is letters inside of a pair of "s. This is a String literal: "ASDF"

    Look again at link that shows how to code switch statements. Compare the code in the tutorial to your code.

    Compilers are very fussy and exacting. If you don't follow the rules, there will be error messages.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #53
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    ok what is the link again

  4. #54
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    Boy are you lazy. It's in this thread somewhere in earlier posts.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #55
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    Like this example: switch (month) {
    case 1: futureMonths.add("January");
    case 2: futureMonths.add("February");
    case 3: futureMonths.add("March");
    case 4: futureMonths.add("April");
    case 5: futureMonths.add("May");
    case 6: futureMonths.add("June");
    case 7: futureMonths.add("July");
    case 8: futureMonths.add("August");
    case 9: futureMonths.add("September");
    case 10: futureMonths.add("October");
    case 11: futureMonths.add("November");
    case 12: futureMonths.add("December");
    break;
    default: break;
    }

    if (futureMonths.isEmpty()) {
    System.out.println("Invalid month number");
    } else {
    for (String monthName : futureMonths) {
    System.out.println(monthName);
    }
    }
    }
    }

    --- Update ---

    very funny,beside I'm a girl.

  6. #56
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    How does that code compare to yours?
    If you don't understand my answer, don't ignore it, ask a question.

  7. #57
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    okay, it says i should use string in this code.Anyway what is ASDF?

  8. #58
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    "ASDF" is a String literal with the 4 letters: ASDF
    Look in post #55 there are a lot of String litterals there with the names of the months in ""s
    If you don't understand my answer, don't ignore it, ask a question.

  9. #59
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    i can use case "A":
    priceCost = 1.00
    how does that sounds?

  10. #60
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    Ask the compiler. It is usually correct.
    If you don't understand my answer, don't ignore it, ask a question.

  11. #61
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    it is. ans i did switch (price.LowerCase())

    --- Update ---

    Great I got error in switch method

    --- Update ---

    hey if and if else have Invalid month and i don't see what it stand for.

  12. #62
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    If you need help with the errors, copy the full text of the error messages and paste it here.
    If you don't understand my answer, don't ignore it, ask a question.

  13. #63
    Member
    Join Date
    Mar 2013
    Posts
    68
    My Mood
    Angelic
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Programming project

    It was due yesterday

  14. #64
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Programming project

    Please mark this thread as solved if you are finished with it.
    If you don't understand my answer, don't ignore it, ask a question.

  15. The Following User Says Thank You to Norm For This Useful Post:

    aw20 (March 11th, 2013)

Page 3 of 3 FirstFirst 123

Similar Threads

  1. android programming vs game programming using java
    By vgoel38 in forum Android Development
    Replies: 4
    Last Post: September 8th, 2012, 05:48 PM
  2. java programming 2 project
    By kin93 in forum Java Theory & Questions
    Replies: 6
    Last Post: June 16th, 2012, 12:00 AM
  3. Jukebox Programming project
    By joneslay_d in forum What's Wrong With My Code?
    Replies: 4
    Last Post: December 2nd, 2010, 02:48 PM
  4. Replies: 2
    Last Post: August 1st, 2010, 06:29 AM
  5. Programming partner that can earn revenue
    By Jay in forum Project Collaboration
    Replies: 0
    Last Post: May 25th, 2009, 02:33 PM