diff --git a/IndexPoint.java b/IndexPoint.java index 8b13789..d9e16ec 100644 --- a/IndexPoint.java +++ b/IndexPoint.java @@ -1 +1,51 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package no2; + +import java.util.Scanner; + +/** + * + * @author made rama_1301154203 + */ +public class No2 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + Scanner Input = new Scanner (System.in); + System.out.print("Masukkan Nilai Kuis : "); + int kuis = Input.nextInt(); + System.out.print(" Nilai UTS : "); + int uts = Input.nextInt(); + System.out.print(" Nilai UAS : "); + int uas = Input.nextInt(); + + int nilai; + nilai = (kuis*25)/100; + nilai = nilai+(uts*35/100); + nilai = nilai+(uas*40/100); + + if (nilai >= 85) { + System.out.println("excellent"); + } + else if (nilai >= 75) { + System.out.println("very good"); + } + else if (nilai >= 65) { + System.out.println("good"); + } + else if (nilai >= 50){ + System.out.println("accepted"); + } + else { + System.out.println("failed"); + } + + } +} diff --git a/PrimeNumber.java b/PrimeNumber.java index 8b13789..f5f931a 100644 --- a/PrimeNumber.java +++ b/PrimeNumber.java @@ -1 +1,48 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package no1; + + +import java.util.Scanner; + + +/** + * + * @author made rama_1301154203 + */ +public class No1 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + Scanner Input = new Scanner (System.in); + System.out.print("Masukkan bilangan : "); + int angka = Input.nextInt(); + + boolean prima = true; + for (int p=2 ; p < angka ; p++ ) + { + if ((angka % p ) == 0) + { + prima = false; + break; + } + } + + if (angka == 1) + System.out.print("Bilangan yang Anda masukkan ini bukan bilangan prima "); + else + if (prima) + System.out.print("Bilangan yang Anda masukkan ini adalah bilangan prima "); + else + System.out.print("Bilangan yang Anda masukkan ini bukan bilangan prima "); + + } + +} diff --git a/TemperatureConvert.java b/TemperatureConvert.java index e69de29..f4ea05e 100644 --- a/TemperatureConvert.java +++ b/TemperatureConvert.java @@ -0,0 +1,42 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package No3; + +import java.util.Scanner; + +/** + * + * made rama_1301154203 + */ +public class No3 { + public static void main(String[] args) { + Scanner Input = new Scanner (System.in); + System.out.print("Masukkan Bilangan dalam Bentuk Celcius : "); + double bilcelcius = Input.nextInt(); + + System.out.println("1. Fahrenheit "); + System.out.println("2. Kelvin "); + System.out.println("3. Reamur "); + + System.out.print("Masukkan Pilihan : "); + int pilih = Input.nextInt(); + double hasil = 0; + + if (pilih == 1) { + hasil = 1.8 * bilcelcius + 32; + } + else if (pilih == 2 ){ + hasil = (273 + bilcelcius); + } + else if (pilih == 3){ + hasil = 0.8 * bilcelcius; + } + + System.out.println("Hasil : "+hasil); + + } +} +