Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1301154511_Nabila Kusuma Putri_IF-39-07 #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
32 changes: 31 additions & 1 deletion IndexPoint.java
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@

import java.util.Scanner;
public class Nilai {
public static void main (String[] args) {
double nilaiAkhir, UAS, UTS, Quiz;
Scanner cin = new Scanner(System.in);
System.out.print("Nilai UTS: ");
UTS=cin.nextDouble();
System.out.print("Nilai UAS: ");
UAS=cin.nextDouble();
System.out.print("Nilai Quiz: ");
Quiz=cin.nextDouble();

nilaiAkhir=(0.35*UTS)+(0.4*UAS)+(0.25*Quiz);

if (nilaiAkhir>=85 && nilaiAkhir<=100) {
System.out.println("Excellent");
}
else if (nilaiAkhir>=75 && nilaiAkhir<=84) {
System.out.println("Very Good");
}
else if (nilaiAkhir>=65 && nilaiAkhir<=74) {
System.out.println("Good");
}
else if (nilaiAkhir>=50 && nilaiAkhir<=64) {
System.out.println("Accepted");
}
else if (nilaiAkhir>=0 && nilaiAkhir<=49) {
System.out.println("Failed");
}
}
}
22 changes: 22 additions & 0 deletions PrimeNumber.java
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
package bilangan.prima;
import java.util.Scanner;
public class BilanganPrima {

public static void main(String[] args) {
int a, b;
int c=0;
Scanner cin = new Scanner(System.in);
System.out.print("Masukkan Angka : ");
a=cin.nextInt();
for (b=1 ; b<=a ; b++) {
if (a % b == 0) {
c=c+1;
}
}
if (c==2) {
System.out.println(a+" merupakan Bilangan Prima");
}
else {
System.out.println(a+" bukan Bilangan Prima");
}
}
}
34 changes: 34 additions & 0 deletions TemperatureConvert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import java.util.Scanner;
public class ConvertSuhu {
public static void main(String[] args) {
double suhu, Fahrenheit, Reamur, Kelvin;
int b;
Scanner cin = new Scanner(System.in);
System.out.println("KONVERSI SUHU");
System.out.print("Masukkan suhu dalam satuan Celcius: ");
suhu=cin.nextDouble();
System.out.println("Suhu akan diubah ke: ");
System.out.println("1. Fahreheit");
System.out.println("2. Reamur");
System.out.println("3. Kelvin");
System.out.print("Masukkan Pilihan: ");
b=cin.nextInt();

Fahrenheit=(1.8*suhu)+32;
Reamur=0.8*suhu;
Kelvin=suhu+273;

if (b==1) {
System.out.println("Convert suhu Celcius ke Fahrenheit: "+Fahrenheit);
}
else if (b==2) {
System.out.println("Convert suhu Celcius ke Reamur: "+Reamur);
}
else if (b==3) {
System.out.println("Convert suhu ke Kelvin: "+Kelvin);
}
else {
System.out.println("Tidak ada pilihan");
}
}
}