wats wrong with my scripts...pls help..

J

jeffjak

Im a newb still studying java programming
wats wrong with my scripts help..?

public class Sample1
{
public static void main (String[] args)
{
String desc;
if (mark >= 85)
desc = "Very Good";
else
if (mark >= 70)
desc= "Good";
else
if (mark >= 50)
desc= "Adequate";
else
desc = "Poor";

System.out.println ("Description=" +desc);
}
}


The error ->
Sample1.java:6: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 85)
^
Sample1.java:9: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 70)
^
Sample1.java:12: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 50)
^
3 errors


btw im using JGrasp software..=) help pls...
 
P

Patricia Shanahan

Im a newb still studying java programming
wats wrong with my scripts help..?

public class Sample1
{
public static void main (String[] args)
{
String desc;
if (mark >= 85)
desc = "Very Good";
else
if (mark >= 70)
desc= "Good";
else
if (mark >= 50)
desc= "Adequate";
else
desc = "Poor";

System.out.println ("Description=" +desc);
}
}


The error ->
Sample1.java:6: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 85)
^
Sample1.java:9: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 70)
^
Sample1.java:12: cannot find symbol
symbol : variable Mark
location: class Sample1
if (Mark >= 50)
^
3 errors


btw im using JGrasp software..=) help pls...

The error messages do not appear to be from the posted software. In
Java, identifier capitalization is significant. "Mark" and "mark" are
different identifiers.

In the code as posted, there is no declaration for "mark". You need to
think through where it is going to come from to decide how to declare
and initialize it.

Patricia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,979
Messages
2,570,183
Members
46,719
Latest member
login dogas.info

Latest Threads

Top