Created
September 21, 2022 17:43
-
-
Save spukles/0a6839957be410ea2a7199fae95a3020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class lbstokg{ | |
//Main Method | |
public static void main (String[] args){ | |
//Declare variables | |
double pounds; | |
double kilograms; | |
//Create a scanner object | |
Scanner input = new Scanner (System.in); | |
//Recieve inputs from keyboard | |
System.out.println("Enter a number in pounds"); | |
pounds = input.nextDouble(); | |
//Compute kilograms | |
//one pound is 0.45359237 | |
kilograms = pounds * 0.45359237; | |
//Display result | |
System.out.println(pounds + " is " + kilograms+ " kilograms "); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment