CODING MENGHITUNG VOLUME BALOK
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package menghitungvbalok;
import java.util.Scanner;
/**
*
* @author lenovo@user
*/
public class MenghitungVBalok {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner (System.in);
double c;
System.out.print("Masukkan panjang balok: ");
int x = input.nextInt();
System.out.print("Masukkan lebar balok: ");
int y = input.nextInt();
System.out.print("Masukkan tinggi balok: ");
int z = input.nextInt();
c = x*y*z;
System.out.println("Volume balok ="+x+"*"+y+"*"+z+"=+c");
System.out.println("Jadi Volume balok adalah :"+c);
}
}
Berikut adalah tampilan coding pada Netbeans.


Tidak ada komentar:
Posting Komentar