Results 1 to 5 of 5
- 02-27-2011, 12:19 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
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.
-
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.
- 02-27-2011, 12:27 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
Thanks.... realised how silly i am. New to java, so please forgive my idiocy...
Thanks again
-
- 02-28-2011, 07:34 AM #5
Similar Threads
-
Cannot find symbol error
By rajivjoshi in forum New To JavaReplies: 3Last Post: 05-31-2010, 10:13 AM -
error cannot find symbol
By jcoon3 in forum New To JavaReplies: 3Last Post: 09-27-2009, 10:56 PM -
cannot find symbol symbol :constructor Error. Please help! =(
By KalEl in forum New To JavaReplies: 9Last Post: 10-18-2008, 08:26 PM -
Error: cannot find symbol
By silvia in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:39 AM -
Error: cannot find symbol
By cachi in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:12 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks