Results 1 to 5 of 5
  1. #1
    Avthar is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Exclamation Please help- Error: cannot find symbol

    Hi, please tell me whats wrong- i have no idea- tried my best, cant see whats wrong: My code is:

    import java.util.Scanner;
    public class Till_Slip
    {
    public static void main(String[]args)
    {
    Scanner input = new Scanner (System.in);

    double p1, p2, p3, Total, VAT, T_VAT_incl, Amt_tend, Change;

    System.output.println("Enter price of item 1");

    p1= input.nextdouble();

    System.output.println("Enter price of item 2");

    p2= input.nextdouble();

    System.output.println("Enter price of item 3");

    p3= input.nextdouble();

    Total = p1 + p2 + p3;

    VAT = 14/100 * Total;

    T_VAT_incl = Total + VAT;

    Sytem.output.println("Enter cash amount tendered");

    Amt_tend = input.nextdouble();

    Change = Amt_tend - T_VAT_incl;





    }
    }

    System.output.println("Enter price of item 2");
    ^
    Till_Slip.java:16: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 3");
    ^
    Till_Slip.java:25: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter cash amount tendered");
    ^
    4 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

    ----jGRASP exec: javac -g Till_Slip.java

    Till_Slip.java:10: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 1");
    ^
    Till_Slip.java:13: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 2");
    ^
    Till_Slip.java:16: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 3");
    ^
    Till_Slip.java:25: package Sytem does not exist
    Sytem.output.println("Enter cash amount tendered");
    ^
    4 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

    ----jGRASP exec: javac -g Till_Slip.java

    Till_Slip.java:10: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 1");
    ^
    Till_Slip.java:11: cannot find symbol
    symbol : method nextdouble()
    location: class java.util.Scanner
    p1= input.nextdouble();
    ^
    Till_Slip.java:13: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 2");
    ^
    Till_Slip.java:14: cannot find symbol
    symbol : method nextdouble()
    location: class java.util.Scanner
    p2= input.nextdouble();
    ^
    Till_Slip.java:16: cannot find symbol
    symbol : variable output
    location: class java.lang.System
    System.output.println("Enter price of item 3");
    ^
    Till_Slip.java:17: cannot find symbol
    symbol : method nextdouble()
    location: class java.util.Scanner
    p3= input.nextdouble();
    ^
    Till_Slip.java:25: package Sytem does not exist
    Sytem.output.println("Enter cash amount tendered");
    ^
    Till_Slip.java:26: cannot find symbol
    symbol : method nextdouble()
    location: class java.util.Scanner
    Amt_tend = input.nextdouble();
    ^
    8 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    The error is telling you exactly what's wrong and it's not very cryptic. You have:

    System.output.println(...)

    and it's telling you that it doesn't know what "output" is, and neither do I. If you check your notes, the online tutorials and/or the Java API for the System class, you'll see that System.out is what is used most commonly here.

    The key to this problem though is to try to get meaning from the error messages, for often they'll tell you exactly what the problem is.

  3. #3
    Avthar is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Default

    Thanks.... realised how silly i am. New to java, so please forgive my idiocy...

    Thanks again

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Avthar View Post
    Thanks.... realised how silly i am. New to java, so please forgive my idiocy...

    Thanks again
    There's absolutely nothing silly about this. Since you weren't born with this knowledge, none of us were, you have to learn it, pure and simple. Luckily it can be a fun process. Oh, and welcome to the forum!

  5. #5
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    6

    Default

    Avthar
    you are great because you admit your mistake
    Fubarable
    You are too great because of your way of motvation with newbie.
    Mak
    (Living @ Virtual World)

Similar Threads

  1. Cannot find symbol error
    By rajivjoshi in forum New To Java
    Replies: 3
    Last Post: 05-31-2010, 10:13 AM
  2. error cannot find symbol
    By jcoon3 in forum New To Java
    Replies: 3
    Last Post: 09-27-2009, 10:56 PM
  3. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  4. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:39 AM
  5. Error: cannot find symbol
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •