//Import Scanner to allow the to input data in the console and have the console read it import java.util.Scanner; public class KgToPound{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); System.out.print("Please input your weight in kg: "); //Initialize variable int num_1 = 1; //Double variable in case user inputs decimal double num_2 = scan.nextDouble(); //Message System.out.println("Kilograms\t|\tPound"); //Fun little loop to compute the weight from 0 to given kg while(num_1 <= num_2){ double variable = num_1*2.2; System.out.printf("%d\t|\t%10.3f\n",num_1,variable); num_1++; } //Compute final result of actual weight double result = num_2*2.2; //Message with result System.out.printf("%4.2f kg is equal to %4.3f pound\n",num_2,result); } }