Program
ke -1
import
java.util.Scanner;
public
class biodata
{
public
static void main(String args[])
{
Scanner
masuk = new Scanner (System.in);
String nama,nomhs;
float
nilaiuts, nilaiuas, nilaitgs, nilaiakhir;
System.out.print("Masukkan
nama anda = ");
nama=masuk.nextLine();
System.out.print("Masukkan
No_mhs anda = ");
nomhs=masuk.nextLine();
System.out.print("Masukkan
Nilai UTS anda = ");
nilaiuts=masuk.nextInt();
System.out.print("Masukkan
Nilai UAS anda = ");
nilaiuas=masuk.nextInt();
System.out.print("Masukkan
Nilai TGS anda = ");
nilaitgs=masuk.nextInt();
System.out.println("
");
nilaiuts=40
* nilaiuts/100;
nilaiuas=70*nilaiuas/100;
nilaitgs=20
* nilaitgs/100;
nilaiakhir=nilaiuts+nilaiuas+nilaitgs/3;
System.out.println("
((( Hasil Perhitungan Nilai )))");
System.out.println("=================================
");
System.out.println("Nama =
RIAN SAADILLAH SUKAMDI");
System.out.println("No_Mhs = 115410127/TI");
System.out.println("Nilai
UTS = "+nilaiuts);
System.out.println("Nilai
UAS = "+nilaiuas);
System.out.println("Nilai
TGS = "+nilaitgs);
System.out.println("
");
System.out.println(")))Jadi
: ");
System.out.println("============
");
System.out.println("Nilai
Akhirnya = "+nilaiakhir);
System.out.println("
");
}
}
|
Hasil
:
Program
ke -2
import
java.util.Scanner;
public
class KonversiSuhu
{
public
static void main(String args[])
{
Scanner
masuk = new Scanner (System.in);
int
celcius;
float
fahreinhet;
System.out.println("
((( Konversi Suhu )))");
System.out.println("=========================
");
System.out.print("Masukan
derajat Celcius = ");
celcius=masuk.nextInt();
fahreinhet=9f/5f*celcius+32f;
System.out.println("
");
System.out.println("Fahreinhet="+fahreinhet);
System.out.println("
");
}
}
|
Hasil
:
Program
ke -3
import
java.util.Scanner;
public
class KonversiSuhu2
{
public
static void main(String args[])
{
Scanner
masuk = new Scanner (System.in);
int
celcius;
float
fahreinhet,reamur,kelvin;
System.out.println("
((( Konversi Suhu )))");
System.out.println("=========================
");
System.out.print("Masukan
derajat Celcius = ");
celcius=masuk.nextInt();
fahreinhet=9f/5f*celcius+32f;
reamur=4/5*celcius;
kelvin=celcius+273;
System.out.println("
");
System.out.println("Fahreinhet="+fahreinhet);
System.out.println("Reamur="+reamur);
System.out.println("Kelvin=
"+kelvin);
System.out.println("
");
}
}
|
Hasil
:
Program
ke -4
import
java.util.Scanner;
public
class volumetabung
{
public
static void main(String args[])
{
Scanner masuk = new
Scanner(System.in);
final float phi=3.14f;
int r;
float volume,t;
System.out.println(" (((
Mencari Volume
Tabung
)))");
System.out.println("===============================
");
System.out.print("Masukkan
Jari-jari Tabung =
");
r=masuk.nextInt();
System.out.print("Masukkan
Tinggi Tabung =
");
t=masuk.nextInt();
volume = phi*r*r*t;
System.out.println(" ");
System.out.println(")))Jadi
:");
System.out.println("=============
");
System.out.println("Volume
Tabungnya =
"+volume);
System.out.println(" ");
}
}
|
Hasil
: