Advertisement
Guest User

trash thing

a guest
Feb 19th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. double weightPounds = (195);
  2. double weightKilos = (weightPounds/2.205);
  3. double weightStones = (weightPounds/14);
  4. weightKilos = (weightKilos*10); // Rounding, because this gives an ugly number
  5. weightKilos = Math.round(weightKilos);
  6. weightKilos = (weightKilos/10);
  7. weightStones = (weightStones*10); // Rounding, because this gives an ugly number
  8. weightStones = Math.round(weightStones);
  9. weightStones = (weightStones/10);
  10. System.out.println("The weight in kilograms is: "+weightKilos);
  11. System.out.println("The weight in stones is: "+weightStones);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement