Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Exercicios;
- import java.util.Scanner;
- public class teste {
- public static void main(String[] args) {
- System.out.println("Convert Pounds into Kg"); // Note for the user
- Scanner input = new Scanner(System.in); // Declaring Scanner
- while (true) {
- if (input.hasNextDouble()) {
- Double Pounds;
- Double Resultado;
- Pounds = input.nextDouble(); // Declare value type used by Scanner
- Resultado = Pounds * 0.4535924;
- System.out.println(Pounds + "Pounds are " + Resultado + "Kg");
- System.out.println("Convert Pounds into Kg");
- }
- else {
- if (input.hasNextLine()) {
- String Erro = input.nextLine();
- System.out.println("Type a numeric value");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement