Net Beans 8.2
MENCARI HASIL PERKALIAN DENGAN SCANNER
------------------------------------------------------------------------------------------------------------------------------------------------------------Import java.util.Scanner;
public class ProgramInputScanner {
/**
*@ param args the command line arguments
*/
public static void main (String[] args) {
// TODO code application logic here
Scanner masukan=new Scanner(System.in);
System.out.print("Masukan Bilangan 1 =");
int bil1=masukan.nextInt();
System.out.print("Masukan Bilangan 2 =");
int bil2=masukan.nextInt();
Int hasil=bil1*bil2;
System.out.println("Hasil Perkalian Bil1 dan Bil2 adalah "+hasil);
}
}
MENCARI LUAS LINGKARAN
-------------------------------------------------------------------------------------------------------------------------------------------------------
import java.util.Scanner;
public class luas_lingkaran {
/**
*@param args the command line arguments
*/
public static void main(String[] args){
//TODO code application logic here
Scanner masukan =new Scanner (System.in);
System.out.print("Masukan jari-jari");
float jarijari1=masukan.nextInt();
float hasil=(jarijari1*jarijari1)*22/7;
System.out.print("Luas lingkaran adalah "+hasil);
}
}
No comments:
Post a Comment