My code works, but it lists each answer 10 times and I cannot figure why. My code is listed below, also are there any hints to make on 2 places after the decimal appear?
public class Test1957 {
// Main Method
public static void main(String[] args) {
System.out.println("Feet\t\t\tMeter\t\t\t\tMeter\t \t\tFoot");
for (double footNumber = 1; footNumber <= 10; footNumber++)
for (double meterNumber = 20; meterNumber <= 65; meterNumber += 5) {
System.out.println(footNumber + "\t\t\t" + footToMeter(footNumber)
+ "\t\t\t\t" + meterNumber + "\t\t\t" + meterToFoot(meterNumber));
}
}
public static double footToMeter(double footNumber) {
double meters;
meters = 0.305 * footNumber;
return meters;
}
public static double meterToFoot(double meterNumber) {
double feet;
feet = meterNumber/0.305;
return feet;
}
}