0

Im getting an error but there doesnt seem to be anything obvious to me.

The purpose is to make a Foot-Meter/Meter-Foot conversion table.

Code:

public class Problem6_9 {
    public static void main (String[] args) {
        //Creating the heading for table
    System.out.printf("%-10s%10s |  %-10s%10s\n" , "Feet","Meters","Meters","Feet");
    System.out.println("----------------------------------------------");
    double startMeter = 20.0;
    for (double i = 1.0; i<=10; i++) {
        System.out.printf("\"%-10.1f%10.3f |  %-10.1f%10.3f\n" , i, ftoMeter(i) ,"|", 
                startMeter, mtoFoot(startMeter));
        startMeter += 5.0;

    }
}
    public static double ftoMeter(double foot) {
        return 0.305 * foot;
    }
    public static double mtoFoot(double meter) {
        return 3.279 * meter;
    }
 }

Error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

    at Problem6_9.main(Problem6_9.java:2)

I've tried to 'Clean' the project and restart but im getting the same error, but it doesnt provide much feedback about what is wrong.

LundinCast
  • 8,746
  • 4
  • 36
  • 46
Thomas123
  • 77
  • 1
  • 4
  • Be careful with your tags as java isn't the same as javascript https://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java – efbbrown Feb 14 '18 at 23:37
  • This may be a strange question, but is this a copy and paste of the current code you're running? Can you make sure that the code you paste in is definitely causing the exception you're seeing? – Mike Feb 14 '18 at 23:56
  • 1
    That error says you ignored an error message from the compiler and tried to execute the program. What is the compiler error message? – Jim Garrison Feb 15 '18 at 00:09

0 Answers0