Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Soal4 {
- public static void main(String[] args) {
- Scanner inputUser = new Scanner(System.in);
- double bb, tb;
- System.out.print("Masukkan Berat Badan = ");
- bb = inputUser.nextDouble();
- System.out.print("Masukkan Tinggi Badan = ");
- tb = inputUser.nextDouble();
- print(bb,tb);
- }
- private static int beratideal(double bb, double tb) {
- return (int) ((bb - 100) - (10/100 * (tb - 100)));
- }
- private static void print(double bb, double tb) {
- System.out.println("Berat badan ideal anda adalah = " + beratideal(bb,tb));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment