import java.io.*;
public class Kalkulator{
public static void main (String []args){
BufferedReader ai = new BufferedReader (new InputStreamReader (System.in));
try{
int bilangan1;
int bilangan2;
int bilangan3;
do{
System.out.println("==============================================================");
System.out.println("\t \"kalkulator sederhana\" \t");
System.out.println("==============================================================");
System.out.println("");
System.out.print("Masukan bilangan 1 : ");
bilangan1 = Integer.parseInt (ai.readLine());
System.out.print("Masukan bilangan 2 : ");
bilangan2 = Integer.parseInt (ai.readLine());
System.out.print("Masukan bilangan 3 : ");
bilangan3 = Integer.parseInt (ai.readLine());
System.out.println("==============================================================");
System.out.println("\t \"kalkulator sederhana\" \t");
System.out.println("==============================================================");
System.out.println("Hasil Penjumlahan : "+ (bilangan1+bilangan2+bilangan3));
System.out.println("Hasil Pengurangan : "+ (bilangan1-bilangan2-bilangan3));
System.out.println("Hasil Perkalian : "+ (bilangan1*bilangan2*bilangan3));
double bagi = (bilangan1/bilangan2)/bilangan3;
System.out.println("Hasil Pembagian : "+ bagi );
System.out.println("Hasil sisa dari bilangan 1 dan 2 : "+(bilangan1%bilangan2) );
double hasilPangkat = Math.pow(bilangan1,bilangan2);
System.out.println("Hasil pangkat dari bilangan 1 dan 2 : "+hasilPangkat);
System.out.println("");
}while(true);
}
catch (Exception e) {
System.out.println("Inputan harus angka");
}
}
}
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar