Vous êtes sur la page 1sur 3

public class sinhvien{ private String name; private float toan; private float li; private float hoa;

public sinhvien(){ name = ""; toan=0; li=0; hoa=0; }

public sinhvien(sinhvien a) { name=a.name; toan=a.toan; li=a.li; hoa=a.hoa; }

public void setname(String nm) { name=nm; } public String getname()

float diem) { if(mon==1) toan=diem. else hoa=diem. } public void setscore(float diem1. hoa=diem3.float diem2. li=diem2. } public float getscore(int mon) { if(mon==1) return toan. } public void setscore(int mon.float diem3) { toan=diem1. else if(mon==2) return li.{ return name. else return hoa. } . else if(mon==2) li=diem.

1f Li: %. if(li>highscore) highscore=li.getAverage()).1f".name. highscore=toan. return highscore.hoa. return average. average = (toan+li+hoa)/3.format("Name: %s \nToan: %. if(hoa>highscore) highscore=hoa.public float getAverage() { float average. } } .toan.li. } public float gethighscore() { float highscore.1f Trung Binh: %.1f Hoa: %. } public String tostring() { return String.