Prog1.java:4: cannot find symbol
symbol : variable sc
location: class Prog1
double f = sc.nextDouble();
^
Prog1.java:6: cannot find symbol
symbol : variable sc
location: class Prog1
double g = sc.nextDouble();
That is the error i receive when i type in the following code
public class Prog1 {
public static void main(String[] args) {
System.out.println("Please Enter Miles");
double f = sc.nextDouble();
System.out.println("Please Enter Gallons");
double g = sc.nextDouble();
System.out.println("Miles per gallon is:");
System.out.println((f/g));
}
}
so what am i doing wrong?