ane punya tugas coding java maklum masih newbie java..
codingan ane harus di lanjutin gan..
Quote:
/**
* @(#)Student.java
*
*
* @author
* @version 1.00 2010/3/11
*/
public class Student {
private String studentid;
private String studentName;
private int scoreUTS,scoreUAS;
public Student(String name, String id)
{
studentid = id;
studentName = name;
}
public double getTotalScore()
{
return((scoreUTS+scoreUAS)/2);
}
public void setScore (int UAS,int UTS){
scoreUTS = UTS;
scoreUAS = UAS;
}
public void show()
{
System.out.println("Student ID :" +studentid);
System.out.println("Student Name :" +studentName);
System.out.println("Total Score :" +getTotalScore());
System.out.println("\n");
}
public static void main(String[] args)
{
Student abc = new Student ("Abrar","30209086");
abc.setScore(90,80);
abc.show();
Student def = new Student ("Habibi","30209072");
def.setScore(90,90);
def.show();
Student ghi = new Student ("Bayu","30209288");
ghi.setScore(40,10);
ghi.show();
}
}
Quote:
hasilnya seperti ini tapi
--------------------Configuration: --------------------
Student ID :30209086
Student Name :Abrar
Total Score :85.0
Student ID :30209072
Student Name :Habibi
Total Score :90.0
Student ID :30209288
Student Name :Bayu
Total Score :25.0
Process completed.
gimana biar dibawah total score itu ada indeks menurut total scorenya
A = > 75
B =>65-50-40-