Here is the code:
Code :import java.util.Scanner; public class Problem2 { public static void main (String []args){ // Scanner Scanner scan = new Scanner(System.in); // Declorations double kilograms = 1; System.out.println("Kilograms\tPounds"); // For loop for (int i = 1; i <= 199; i += 2) { System.out.println(i + " " + i * 2.2); } } }
The answers give me two columns, but the problem is sometimes there are 10 zeros after the decimal so for the third answer it is 6.6000000000 etc. I just want to use one character after the decimal and I don't know how. I have tried the printf and using %d,f etc but that didn't work :/
