Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions IndexPoint.java
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
/*
* 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.

* Nama : Afif Darmawan
* NIM : 1301154133
* Kelas: IF 39-07
*/
package tugas1;
import java.util.Scanner;
/**
*
* @author acer
*/
public class No2 {
public static void main(String [] args){
Scanner input = new Scanner (System.in);
final double n_UTS, n_UAS, n_Kuis, n_Akhir;
String grade;
System.out.print("Masukkan Nilai UTS : ");
n_UTS = input.nextInt();
System.out.print("Masukkan Nilai UAS : ");
n_UAS = input.nextInt();
System.out.print("Masukkan Nilai Kuis: ");
n_Kuis = input.nextInt();

n_Akhir = (0.35 * n_UTS) + (0.4 * n_UAS) + (0.25 * n_Kuis);
System.out.println("Hasil Dari Nilai Akhir Adalah : " + n_Akhir);

if (n_Akhir >= 85 && n_Akhir <= 100){
System.out.println("Excellent");
}
else if (n_Akhir >= 75 && n_Akhir<=84){
System.out.println("Very Good");
}
else if (n_Akhir >=65 && n_Akhir<=74){
System.out.println("Good");
}
else if (n_Akhir >=50 && n_Akhir<=64){
System.out.println("Accepted");
}
else if (n_Akhir >= 0 && n_Akhir<=49){
System.out.println("Failed");
}
}
}


30 changes: 30 additions & 0 deletions PrimeNumber.java
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
/*
* 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.

* Nama : Afif Darmawan
* NIM : 1301154133
* Kelas: IF 39-07
*/
package tugas1;
import javax.swing.JOptionPane;

public class No1 {

public static void main(String[] args){
int angka =Integer.parseInt(JOptionPane.showInputDialog("Masukkan Bilangan: "));
//System.out.println("Masukkan Angka Yang Anda Inputkan : ");
boolean prima=false;
if(angka>=2){
prima=true;
for(int a=2; a<angka; a++){
if(angka%a==0){
prima=false;
break;
}
}
}
System.out.println((prima==true?angka+ "BILANGAN PRIMA":angka+"BUKAN BILANGAN PRIMA"));
}
}

50 changes: 50 additions & 0 deletions TemperatureConvert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.


* Nama : Afif Darmawan
* NIM : 1301154133
* Kelas: IF 39-07
*/
package tugas1;
import java.util.Scanner;
//import java.io
/**
*
* @author acer
*/
public class No3 {
public static void main(String[] args){
Scanner input= new Scanner(System.in);
double celcius, hasilfahrenheit, hasilkelvin, hasilreamur;

System.out.print("Masukkan Suhu Dalam Celcius : ");
celcius = input.nextInt();
System.out.println("");
System.out.println("1. Fahrenheit");
System.out.println("2. Kelvin");
System.out.println("3. Reamur");
System.out.println("Masukkan Pilihan Perubahan Suhu");
int pilih = input.nextInt();
System.out.println("");

switch(pilih){
case 1:
hasilfahrenheit = (celcius*9/5)+32;
System.out.println(celcius+"Celcius = "+ hasilfahrenheit+"Fahrenheit");
break;
case 2:
hasilkelvin = (celcius+273.15);
System.out.println(celcius +"Celcius ="+ hasilkelvin +"Kelvin");
break;
case 3:
hasilreamur = celcius * 4/5;
System.out.println(celcius +"Celcius ="+ hasilreamur +"Reamur");
break;
default:
System.out.println("Pilihan Yang Anda Masukkan Tidak Benar");
}
}
}