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
36 changes: 35 additions & 1 deletion IndexPoint.java
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@

/*
* 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 task1;

import java.util.Scanner;

/**
*
* @author ASUS
*/
public class IndexPoint {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Masukkan nilai UTS : ");
int UTS = input.nextInt();
System.out.print("Masukkan nilai UAS : ");
int UAS = input.nextInt();
System.out.print("Masukkan nilai Quiz: ");
int Quiz = input.nextInt();
double NilaiTotal = 0.35*UTS + 0.4*UAS + 0.25*Quiz;
if (NilaiTotal >=85 && NilaiTotal<=100)
System.out.println("Excelent");
else if(NilaiTotal >=75 && NilaiTotal <=84)
System.out.println("Very Good");
else if(NilaiTotal >=65 && NilaiTotal <=74)
System.out.println("Good");
else if(NilaiTotal >=50 && NilaiTotal <= 64)
System.out.println("Accepted");
else
System.out.println("Failed");
}
}
36 changes: 35 additions & 1 deletion PrimeNumber.java
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@

/*
* 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 task1;

import java.util.Scanner;

/**
*
* @author ASUS
*/
public class PrimeNumber {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Masukkan angka: ");
int x = input.nextInt();
int y = 0;
for (int i = 1;i<=x;i++)
{
if (x%i==0)
y+=1;
}

if (y==2)
System.out.println("Bilangan Prima");
else
System.out.println("Bukan bilangan prima");


}

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

import java.util.Scanner;

/**
*
* @author ASUS
*/
public class TemperatureConvert {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Masukkan suhu celcius: ");
int celcius = input.nextInt();
int reamur = celcius*4/5;
int fahrenheit = celcius*9/5+32;
int kelvin = celcius+273;
int menu = 1;
while (menu>0){
System.out.println("Menu convert");
System.out.println("1. Reamur");
System.out.println("2. Fahrenheit");
System.out.println("3. Kelvin");
System.out.println("0. Exit");
System.out.print("Pilih menu : ");
menu = input.nextInt();
switch (menu){
case 1:
System.out.println(reamur);
break;
case 2:
System.out.println(fahrenheit);
break;
case 3:
System.out.println(kelvin);
break;
}
}

}
}