coding :
public class algoritma {
public String nama;
public String nim;
public String fakultas;
public double tugas;
public double uts;
public double uas;
public double rata2;
void print (){
System.out.println("Nama :"+"\t"+nama);
System.out.println("Masukan NIM :"+"\t"+nim);
System.out.println("Fakultas :"+"\t"+fakultas);
}
void nilai(){
//
rata2=(tugas+uts+uas)/3;
System.out.println("Nilai rata2 :"+"\t"+rata2);
}
public static void main(String[] args) {
algoritma x =new algoritma();{
x.nama=("gaguh");
x.nim=("2012420019");
x.fakultas=("teknik informatika");
x.tugas=50;
x.uts=60;
x.uas=50;
x.print();
x.nilai();
}
}
}
output :
NIM : 2012420019
Kelas : A
Posted by 10.05 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar