-
07-25-2013, 07:00 AM #11Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
bác nào dảnh test bài giúp e chút nhé :d
sinhvien<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package nhansu[/color][color=#007700]; [/color][color=#ff8000]/**** @author mrkhoai*/[/color][color=#007700]public class [/color][color=#0000bb]sinhvien [/color][color=#007700]{ public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getlop[/color][color=#007700]() { return [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]void setlop[/color][color=#007700]([/color][color=#0000bb]string lop[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]float gett[/color][color=#007700]() { return [/color][color=#0000bb]t[/color][color=#007700]; } public [/color][color=#0000bb]void sett[/color][color=#007700]([/color][color=#0000bb]float t[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]t [/color][color=#007700]= [/color][color=#0000bb]t[/color][color=#007700]; } public [/color][color=#0000bb]float getl[/color][color=#007700]() { return [/color][color=#0000bb]l[/color][color=#007700]; } public [/color][color=#0000bb]void setl[/color][color=#007700]([/color][color=#0000bb]float l[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]l [/color][color=#007700]= [/color][color=#0000bb]l[/color][color=#007700]; } public [/color][color=#0000bb]float geth[/color][color=#007700]() { return [/color][color=#0000bb]h[/color][color=#007700]; } public [/color][color=#0000bb]void seth[/color][color=#007700]([/color][color=#0000bb]float h[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]h [/color][color=#007700]= [/color][color=#0000bb]h[/color][color=#007700]; } public [/color][color=#0000bb]sinhvien[/color][color=#007700]() { } private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]string lop[/color][color=#007700]; private [/color][color=#0000bb]float t[/color][color=#007700]; private [/color][color=#0000bb]float l[/color][color=#007700]; private [/color][color=#0000bb]float h[/color][color=#007700]; public [/color][color=#0000bb]float diemtb[/color][color=#007700]([/color][color=#0000bb]float t[/color][color=#007700],[/color][color=#0000bb]float l[/color][color=#007700], [/color][color=#0000bb]float h[/color][color=#007700]){ return (float)([/color][color=#0000bb]t[/color][color=#007700]+[/color][color=#0000bb]l[/color][color=#007700]+[/color][color=#0000bb]h[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; }public [/color][color=#0000bb]string xeploai[/color][color=#007700]([/color][color=#0000bb]float diemtb[/color][color=#007700]){ if( [/color][color=#0000bb]diemtb [/color][color=#007700]>=[/color][color=#0000bb]8 [/color][color=#007700]&& [/color][color=#0000bb]diemtb[/color][color=#007700]<=[/color][color=#0000bb]10[/color][color=#007700]) return [/color][color=#dd0000]"giỏi"[/color][color=#007700]; if([/color][color=#0000bb]diemtb[/color][color=#007700]>=[/color][color=#0000bb]6.5 [/color][color=#007700]&& [/color][color=#0000bb]diemtb[/color][color=#007700]<[/color][color=#0000bb]8[/color][color=#007700]) return [/color][color=#dd0000]"khá"[/color][color=#007700]; if([/color][color=#0000bb]diemtb[/color][color=#007700]>=[/color][color=#0000bb]5 [/color][color=#007700]&& [/color][color=#0000bb]diemtb[/color][color=#007700]<[/color][color=#0000bb]6.5[/color][color=#007700]) return [/color][color=#dd0000]"trung bình"[/color][color=#007700]; if([/color][color=#0000bb]diemtb[/color][color=#007700]>=[/color][color=#0000bb]0 [/color][color=#007700]&& [/color][color=#0000bb]diemtb[/color][color=#007700]<[/color][color=#0000bb]5[/color][color=#007700]) return [/color][color=#dd0000]"yếu"[/color][color=#007700]; return [/color][color=#dd0000]"nhập điểm sai"[/color][color=#007700]; }}[/color]
</div>
</div>
giangvien<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package nhansu[/color][color=#007700]; [/color][color=#ff8000]/**** @author mrkhoai*/[/color][color=#007700]public class [/color][color=#0000bb]giangvien [/color][color=#007700]{ public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getlop[/color][color=#007700]() { return [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]void setlop[/color][color=#007700]([/color][color=#0000bb]string lop[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]int getnsinh[/color][color=#007700]() { return [/color][color=#0000bb]nsinh[/color][color=#007700]; } public [/color][color=#0000bb]void setnsinh[/color][color=#007700]([/color][color=#0000bb]int nsinh[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]nsinh [/color][color=#007700]= [/color][color=#0000bb]nsinh[/color][color=#007700]; } public [/color][color=#0000bb]int getluong[/color][color=#007700]() { return [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]void setluong[/color][color=#007700]([/color][color=#0000bb]int luong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luong [/color][color=#007700]= [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]giangvien[/color][color=#007700]() { } private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]string lop[/color][color=#007700]; private [/color][color=#0000bb]int nsinh[/color][color=#007700]; private [/color][color=#0000bb]int luong[/color][color=#007700]; }[/color]
</div>
</div>
main<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package nhansu[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; [/color][color=#ff8000]/**** @author mrkhoai*/[/color][color=#007700]public class [/color][color=#0000bb]main [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập thông tin sinh viên : "[/color][color=#007700]); [/color][color=#0000bb]scanner in[/color][color=#007700]=new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]sinhvien a[/color][color=#007700]=new [/color][color=#0000bb]sinhvien[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập họ tên sinh viên :"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập lớp học : "[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập điểm toán lý hóa :"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]sett[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setl[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]seth[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập thông tin giảng viên : "[/color][color=#007700]); [/color][color=#0000bb]giangvien b[/color][color=#007700]=new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập họ tên giảng viên :"[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập lớp dạy : "[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap năm sinh : "[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setnsinh[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhâp lương : "[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setluong[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thông tin giảng viên :"[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()+[/color][color=#dd0000]" ,dạy lớp: "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]()+[/color][color=#dd0000]" ,sinh năm : "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getnsinh[/color][color=#007700]()+[/color][color=#dd0000]" ,lương : "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getluong[/color][color=#007700]()); if([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]()==[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]()){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thông tin sinh viên :"[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()+[/color][color=#dd0000]" ,lớp: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]()+ [/color][color=#dd0000]" ,điểm trung bình: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gett[/color][color=#007700](), [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getl[/color][color=#007700](), [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]geth[/color][color=#007700]()) +[/color][color=#dd0000]" ,xếp loại: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]xeploai[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gett[/color][color=#007700](),[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getl[/color][color=#007700](),[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]geth[/color][color=#007700]()))+[/color][color=#dd0000]",giáo viên dạy :"[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()); } else{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thông tin sinh viên :"[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()+[/color][color=#dd0000]" ,lớp : "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]()+[/color][color=#dd0000]" ,điểm trung bình: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gett[/color][color=#007700](), [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getl[/color][color=#007700](), [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]geth[/color][color=#007700]())+[/color][color=#dd0000]" ,xếp loại: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]xeploai[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gett[/color][color=#007700](),[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getl[/color][color=#007700](),[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]geth[/color][color=#007700]()))); } }}[/color]
</div>
</div>
-
08-01-2013, 07:00 AM #12Junior Member
- Ngày tham gia
- Dec 2014
- Bài viết
- 0
mình gửi bài, các bạn xem giúp mình với.
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:package bai15; import java.util.scanner; public class getter_setter { /** * @param args */ public static void main(string[] args) { // todo auto-generated method stub sinhvien sv=new sinhvien(); giangvien gv=new giangvien(); sv.input(); gv.input(); sv.display(); gv.display(); string lhsv=sv.getlophoc(); string ldgv=gv.getlopday(); if(lhsv.equals(ldgv)){ system.out.println("giang vien: "+gv.gethoten()+" co day sinh vien: "+sv.gethoten()); } else system.out.println("giang vien: "+gv.gethoten()+" khong day sinh vien: "+sv.gethoten()); } } class sinhvien{ private string hoten,lophoc; private float toan,ly,hoa; public string gethoten(){ return hoten; } public string getlophoc(){ return lophoc; } public float gettoan(){ return toan; } public float getly(){ return ly; } public float gethoa(){ return hoa; } public void sethoten(string hoten){ this.hoten=hoten; } public void setlophoc(string lophoc){ this.lophoc=lophoc; } public void setly(int ly){ this.ly=ly; } public void sethoa(int hoa){ this.hoa=hoa; } public void settoan(int toan){ this.toan=toan; } public void input(){ scanner ipt=new scanner(system.in); system.out.println("nhap ten hoc sinh: "); hoten=ipt.nextline(); system.out.println("nhap lop hoc: "); lophoc=ipt.nextline(); system.out.println("nhap diem toan: "); toan=ipt.nextfloat(); system.out.println("nhap diem ly: "); ly=ipt.nextfloat(); system.out.println("nhap diem hoa: "); hoa=ipt.nextfloat(); } public float diemtb(float toan,float ly,float hoa){ return (toan+ly+hoa)/3; } public string xlhocluc(float diemtb){ string xl=" "; if(diemtb(toan, ly, hoa)>=8.5 && diemtb(toan, ly, hoa)<=10)xl= "gioi"; else if(diemtb(toan, ly, hoa)<8.5 && diemtb(toan, ly, hoa)>=7.0)xl="kha"; else if(diemtb(toan, ly, hoa)<7.0 && diemtb(toan, ly, hoa)>=5.5)xl= "tb"; else xl="yeu"; return xl; } public void display(){ system.out.println("hoc sinh: "+hoten); system.out.println("lop: "+lophoc); system.out.println("diem toan: "+toan+", diem ly: "+ly+",diem hoa: "+hoa); system.out.println("diem trung binh: "+diemtb(toan, ly, hoa)); system.out.println("xep loai hoc luc: "+xlhocluc(diemtb(toan,ly,hoa))); } } class giangvien{ private string hoten,lopday; private int namsinh; private float luong; public string gethoten() { return hoten; } public void sethoten(string hoten) { this.hoten = hoten; } public string getlopday() { return lopday; } public void setlopday(string lopday) { this.lopday = lopday; } public int getnamsinh() { return namsinh; } public void setnamsinh(int namsinh) { this.namsinh = namsinh; } public float getluong() { return luong; } public void setluong(float luong) { this.luong = luong; } public void input(){ scanner iptgv=new scanner(system.in); system.out.println("nhap ho ten giang vien: "); hoten=iptgv.nextline(); system.out.println("nhap lop day: "); lopday=iptgv.nextline(); system.out.println("nhap nam sinh: "); namsinh=iptgv.nextint(); system.out.println("nhap luong: "); luong=iptgv.nextfloat(); } public void display(){ system.out.println("giang vien: "+hoten); system.out.println("lop day: "+lopday); system.out.println("nam sinh: "+namsinh); system.out.println("muc luong: "+luong); } }
</div>
</div>
-
08-08-2013, 07:00 AM #13Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
class sinhvien
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:package nhansu; public class sinhvien { private string hoten; private int lophoc; private int diemtoan,diemly,diemhoa; public void sethoten(string hoten) { this.hoten = hoten; } public void setlophoc(int lophoc){ this.lophoc = lophoc; } public void setdiemtoan(int diemtoan){ this.diemtoan = diemtoan; } public void setdiemly(int diemly){ this.diemly = diemly; } public void setdiemhoa(int diemhoa){ this.diemhoa = diemhoa; } public string gethoten(){ return hoten; } public int getlophoc(){ return lophoc; } public int getdiemtoan(){ return diemtoan; } public int getdiemly(){ return diemly; } public int getdiemhoa(){ return diemhoa; } }
</div>
</div>
class giangvien
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:package nhansu; public class giangvien { private string hoten; private int lopday; private int namsinh; private int luong; public string gethoten() { return hoten; } public void sethoten(string hoten) { this.hoten = hoten; } public int getlopday() { return lopday; } public void setlopday(int lopday) { this.lopday = lopday; } public int getnamsinh() { return namsinh; } public void setnamsinh(int namsinh) { this.namsinh = namsinh; } public int getluong() { return luong; } public void setluong(int luong) { this.luong = luong; } }
</div>
</div>
class main
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:package nhansu; import java.util.scanner; public class main { /** * @param args */ sinhvien hocsinha = new sinhvien (); giangvien giangvienb = new giangvien(); public static void main(string[] args) { // todo auto-generated method stub main a = new main(); a.nhapdulieu1(); a.nhapdulieu2(); a.indulieu(); a.xulydulieu(); } public void nhapdulieu1(){ system.out.println("nhập dữ liệu học sinh: "); scanner input1 = new scanner(system.in); system.out.println("nhập họ và tên học sinh: "); hocsinha.sethoten(input1.nextline()); system.out.println("nhập lớp học: "); hocsinha.setlophoc(input1.nextint()); system.out.println("nhập điểm toán: "); hocsinha.setdiemtoan(input1.nextint()); system.out.println("nhập điểm lý: "); hocsinha.setdiemly(input1.nextint()); system.out.println("nhập điểm hóa: "); hocsinha.setdiemhoa(input1.nextint()); } public void nhapdulieu2(){ system.out.println("nhập dữ liệu giảng viên: "); scanner input2 = new scanner (system.in); system.out.println("nhập họ và tên giảng viên: "); giangvienb.sethoten(input2.nextline()); system.out.println("nhập lớp dạy: "); giangvienb.setlopday(input2.nextint()); system.out.println("nhập năm sinh: "); giangvienb.setnamsinh(input2.nextint()); system.out.println("nhập tiền lương: "); giangvienb.setluong(input2.nextint()); } public void indulieu(){ system.out.println("thông tin học sinh: "); system.out.println("tên của học sinh: " + hocsinha.gethoten()); system.out.println("lớp học: " + hocsinha.getlophoc()); system.out.println("điểm toán: " + hocsinha.getdiemtoan()); system.out.println("điểm lý: " + hocsinha.getdiemly()); system.out.println("điểm lý: " + hocsinha.getdiemhoa()); system.out.println("thông tin giảng viên: "); system.out.println("tên của giảng viên: "+ giangvienb.gethoten()); system.out.println("lớp dạy: "+ giangvienb.getlopday()); system.out.println("năm sinh: " + giangvienb.getnamsinh()); system.out.println("tiền lương: "+ giangvienb.getluong()); } public void xulydulieu(){ int diemtrungbinh = (hocsinha.getdiemtoan()+hocsinha.getdiemly()+hocsinha.getdiemhoa())/3; system.out.println("điểm trung bình của học sinh là "+ diemtrungbinh); if(diemtrungbinh>8) system.out.println("học sinh xếp loại giỏi"); else if (diemtrungbinh<6) system.out.println("học sinh xếp loại trung bình"); else system.out.println("học sinh xếp loại khá"); if(hocsinha.getlophoc()==giangvienb.getlopday()) system.out.println("giảng viên b dạy lớp có học sinh a"); else system.out.println("giảng viên b không dạy lớp có học sinh a"); } }
</div>
</div>
-
09-09-2013, 07:00 AM #14Junior Member
- Ngày tham gia
- Jun 2014
- Bài viết
- 0
minh nop bai (package nhan su)
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
</blockquote></div>
</div>
</div>
-
09-17-2013, 07:00 AM #15Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
ngày đó ngày đó[/color][color=#007700], [/color][color=#0000bb]ngày đó sẽ không xa vời[/color][color=#007700].[/color][color=#0000bb]và chúng ta là người chiến thắng[/color][color=#007700]....[/color]
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]-[/color][color=#0000bb]manager[/color][color=#007700].[/color][color=#0000bb]java[/color][color=#007700]: [/color][color=#0000bb]package nhansu[/color][color=#007700];[/color][color=#0000bb]import nhansu[/color][color=#007700].[/color][color=#0000bb]student[/color][color=#007700];[/color][color=#0000bb]import nhansu[/color][color=#007700].[/color][color=#0000bb]teacher[/color][color=#007700]; public class [/color][color=#0000bb]manager [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string args [/color][color=#007700][]) { [/color][color=#0000bb]student a [/color][color=#007700]= new [/color][color=#0000bb]student[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setnameclassmate[/color][color=#007700]([/color][color=#dd0000]"ho hoai kiet"[/color][color=#007700], [/color][color=#dd0000]"cong nghe phan mem"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setscore[/color][color=#007700]([/color][color=#0000bb]7[/color][color=#007700], [/color][color=#0000bb]8[/color][color=#007700], [/color][color=#0000bb]9[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]showaverage[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]xeploai[/color][color=#007700](); [/color][color=#0000bb]teacher b [/color][color=#007700]= new [/color][color=#0000bb]teacher[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setnameclassmate[/color][color=#007700]([/color][color=#dd0000]"truong van quoc nhat"[/color][color=#007700],[/color][color=#dd0000]"cong nghe phan mem" [/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setyearsalary[/color][color=#007700]([/color][color=#0000bb]1928[/color][color=#007700], [/color][color=#0000bb]6000[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]showteacher[/color][color=#007700](); if( [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]classmate[/color][color=#007700]().[/color][color=#0000bb]compareto[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]classmate[/color][color=#007700]())==[/color][color=#0000bb]0[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giao vien co day hoc sinh nay"[/color][color=#007700]); else [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giao vien khong day hoc sinh nay!"[/color][color=#007700]); }[/color][color=#ff8000]//method main.[/color][color=#007700]}[/color][color=#ff8000]//class manager. [/color][color=#007700]-[/color][color=#0000bb]teacher[/color][color=#007700].[/color][color=#0000bb]java[/color][color=#007700]: [/color][color=#0000bb]package nhansu[/color][color=#007700]; public class [/color][color=#0000bb]teacher [/color][color=#007700]{ private [/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]classmate[/color][color=#007700]; private [/color][color=#0000bb]int year[/color][color=#007700], [/color][color=#0000bb]salary[/color][color=#007700]; [/color][color=#ff8000]//setter. [/color][color=#007700]public [/color][color=#0000bb]void setnameclassmate [/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string classmate[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]classmate [/color][color=#007700]= [/color][color=#0000bb]classmate[/color][color=#007700]; }[/color][color=#ff8000]//method setnameclassmate. [/color][color=#007700]public [/color][color=#0000bb]void setyearsalary[/color][color=#007700]([/color][color=#0000bb]int year[/color][color=#007700], [/color][color=#0000bb]int salary[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]year [/color][color=#007700]= [/color][color=#0000bb]year[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]salary [/color][color=#007700]= [/color][color=#0000bb]salary[/color][color=#007700]; }[/color][color=#ff8000]//method setyearsalary. [/color][color=#007700]public [/color][color=#0000bb]string getnamclassmate[/color][color=#007700]() { return ( [/color][color=#0000bb]name [/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+ [/color][color=#0000bb]classmate [/color][color=#007700]); }[/color][color=#ff8000]// method getnamclassmate. [/color][color=#007700]public [/color][color=#0000bb]int getyear[/color][color=#007700]() { return ( [/color][color=#0000bb]year [/color][color=#007700]); } public [/color][color=#0000bb]int getsalary[/color][color=#007700]() { return ( [/color][color=#0000bb]salary [/color][color=#007700]); } public [/color][color=#0000bb]void showteacher[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"name: "[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]"\t classmate: "[/color][color=#007700]+[/color][color=#0000bb]classmate[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"year; "[/color][color=#007700]+[/color][color=#0000bb]year[/color][color=#007700]+[/color][color=#dd0000]"\t salary: "[/color][color=#007700]+[/color][color=#0000bb]salary[/color][color=#007700]); } public [/color][color=#0000bb]string classmate[/color][color=#007700]() { return [/color][color=#0000bb]classmate[/color][color=#007700]; }[/color][color=#ff8000]//method classmate.[/color][color=#007700]}[/color][color=#ff8000]//class teacher. [/color][color=#007700]-[/color][color=#0000bb]student[/color][color=#007700].[/color][color=#0000bb]java[/color][color=#007700]:[/color][color=#0000bb]package nhansu[/color][color=#007700]; public class [/color][color=#0000bb]student [/color][color=#007700]{ private [/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]classmate[/color][color=#007700]; private [/color][color=#0000bb]int math[/color][color=#007700], [/color][color=#0000bb]phisics[/color][color=#007700], [/color][color=#0000bb]chemistry[/color][color=#007700]; public [/color][color=#0000bb]void setnameclassmate[/color][color=#007700]([/color][color=#0000bb]string name[/color][color=#007700], [/color][color=#0000bb]string classmate[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]classmate [/color][color=#007700]= [/color][color=#0000bb]classmate[/color][color=#007700]; }[/color][color=#ff8000]//method setnameclassmate. [/color][color=#007700]public [/color][color=#0000bb]void setscore[/color][color=#007700]([/color][color=#0000bb]int math[/color][color=#007700], [/color][color=#0000bb]int phisics[/color][color=#007700], [/color][color=#0000bb]int chemistry[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]math [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]phisics [/color][color=#007700]= [/color][color=#0000bb]phisics[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]chemistry [/color][color=#007700]= [/color][color=#0000bb]chemistry[/color][color=#007700]; }[/color][color=#ff8000]// method setscore. [/color][color=#007700]public [/color][color=#0000bb]string getnameclassmate[/color][color=#007700]() { return ([/color][color=#0000bb]name [/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+ [/color][color=#0000bb]classmate[/color][color=#007700]); }[/color][color=#ff8000]//method getnamclassmate. [/color][color=#007700]public [/color][color=#0000bb]int getmath[/color][color=#007700]() { return [/color][color=#0000bb]math[/color][color=#007700]; } public [/color][color=#0000bb]int getphisics[/color][color=#007700]() { return [/color][color=#0000bb]phisics[/color][color=#007700]; } public [/color][color=#0000bb]int getchemistry[/color][color=#007700]() { return [/color][color=#0000bb]chemistry[/color][color=#007700]; } public [/color][color=#0000bb]void showaverage[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam: "[/color][color=#007700]+[/color][color=#0000bb]name [/color][color=#007700]+[/color][color=#dd0000]"\t classmate: "[/color][color=#007700]+[/color][color=#0000bb]classmate[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"math: "[/color][color=#007700]+[/color][color=#0000bb]math [/color][color=#007700]+[/color][color=#dd0000]"\t phisics: "[/color][color=#007700]+[/color][color=#0000bb]phisics [/color][color=#007700]+[/color][color=#dd0000]" chemistry: "[/color][color=#007700]+[/color][color=#0000bb]chemistry[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"average: "[/color][color=#007700]+( (float) ([/color][color=#0000bb]math[/color][color=#007700]+[/color][color=#0000bb]chemistry[/color][color=#007700]+[/color][color=#0000bb]phisics[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]) ); } public [/color][color=#0000bb]void xeploai[/color][color=#007700]() { [/color][color=#0000bb]float tb [/color][color=#007700]= (([/color][color=#0000bb]math[/color][color=#007700]+[/color][color=#0000bb]chemistry[/color][color=#007700]+[/color][color=#0000bb]phisics[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]); if( [/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]8 [/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"xeploai: gioi"[/color][color=#007700]); if( [/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]6.5 [/color][color=#007700]&& [/color][color=#0000bb]tb[/color][color=#007700]<[/color][color=#0000bb]8 [/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"xeploai: kha"[/color][color=#007700]); if( [/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]5 [/color][color=#007700]&& [/color][color=#0000bb]tb[/color][color=#007700]<[/color][color=#0000bb]7 [/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"xeploai: trungbinh"[/color][color=#007700]); if( [/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]0 [/color][color=#007700]&& [/color][color=#0000bb]tb[/color][color=#007700]<[/color][color=#0000bb]5 [/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"xeploai: thoivecayruong"[/color][color=#007700]); }[/color][color=#ff8000]//method xeploai. [/color][color=#007700]public [/color][color=#0000bb]string classmate[/color][color=#007700]() { return [/color][color=#0000bb]classmate[/color][color=#007700]; }[/color][color=#ff8000]// method classmate.[/color][color=#007700]}[/color][color=#ff8000]// class student.[/color]
</div>
</div>
-
09-17-2013, 07:00 AM #16Junior Member
- Ngày tham gia
- Jun 2014
- Bài viết
- 0
không hiểu đoạn tính xếp loại mình sai chỗ nào mà lúc nhập xong nó tính 0.0 xếp loại yếu x.x
class hocsinh
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package nhansu[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]hocsinh [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]string lop[/color][color=#007700]; private [/color][color=#0000bb]float toan[/color][color=#007700],[/color][color=#0000bb]ly[/color][color=#007700],[/color][color=#0000bb]hoa[/color][color=#007700]; private [/color][color=#0000bb]float diemtb[/color][color=#007700]; public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten1[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten1[/color][color=#007700]; } public [/color][color=#0000bb]void setlop[/color][color=#007700]([/color][color=#0000bb]string lop1[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]lop1[/color][color=#007700]; } public [/color][color=#0000bb]void settoan[/color][color=#007700]([/color][color=#0000bb]float toan1[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]= [/color][color=#0000bb]toan1[/color][color=#007700]; } public [/color][color=#0000bb]void setly[/color][color=#007700]([/color][color=#0000bb]float ly1[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]= [/color][color=#0000bb]ly1[/color][color=#007700]; } public [/color][color=#0000bb]void sethoa[/color][color=#007700]([/color][color=#0000bb]float hoa1[/color][color=#007700]){ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]= [/color][color=#0000bb]hoa1[/color][color=#007700]; } public [/color][color=#0000bb]string gethoten[/color][color=#007700](){ return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getlop[/color][color=#007700](){ return [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]float gettoan[/color][color=#007700](){ return [/color][color=#0000bb]toan[/color][color=#007700]; } public [/color][color=#0000bb]float getly[/color][color=#007700](){ return [/color][color=#0000bb]ly[/color][color=#007700]; } public [/color][color=#0000bb]float gethoa[/color][color=#007700](){ return [/color][color=#0000bb]hoa[/color][color=#007700]; } public [/color][color=#0000bb]float diemtb[/color][color=#007700]([/color][color=#0000bb]float toan[/color][color=#007700],[/color][color=#0000bb]float ly[/color][color=#007700], [/color][color=#0000bb]float hoa[/color][color=#007700]){ [/color][color=#0000bb]diemtb [/color][color=#007700]= ([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; return [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]string hocluc[/color][color=#007700]([/color][color=#0000bb]float diemtb[/color][color=#007700]){ if ([/color][color=#0000bb]diemtb [/color][color=#007700]>=[/color][color=#0000bb]8.0[/color][color=#007700]){ return [/color][color=#dd0000]" gioi "[/color][color=#007700]; } else if ([/color][color=#0000bb]diemtb [/color][color=#007700]< [/color][color=#0000bb]5.0 [/color][color=#007700]&& [/color][color=#0000bb]diemtb [/color][color=#007700]>= [/color][color=#0000bb]3.5[/color][color=#007700]){ return [/color][color=#dd0000]" trung binh "[/color][color=#007700]; } else if ([/color][color=#0000bb]diemtb [/color][color=#007700]< [/color][color=#0000bb]3.5[/color][color=#007700]){ return [/color][color=#dd0000]" yeu "[/color][color=#007700]; } else { return [/color][color=#dd0000]" kha "[/color][color=#007700]; } } public [/color][color=#0000bb]void nhaphs[/color][color=#007700](){ [/color][color=#0000bb]scanner in [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ten sv: "[/color][color=#007700]); [/color][color=#0000bb]sethoten[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lop: "[/color][color=#007700]); [/color][color=#0000bb]setlop[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"diem toan: "[/color][color=#007700]); [/color][color=#0000bb]settoan[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"diem ly: "[/color][color=#007700]); [/color][color=#0000bb]setly[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"diem hoa: "[/color][color=#007700]); [/color][color=#0000bb]sethoa[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); } public [/color][color=#0000bb]void showtt[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thong tin: "[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten: " [/color][color=#007700]+[/color][color=#0000bb]gethoten[/color][color=#007700]()+[/color][color=#dd0000]" -lop: "[/color][color=#007700]+[/color][color=#0000bb]getlop[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"diem toan: "[/color][color=#007700]+[/color][color=#0000bb]gettoan[/color][color=#007700]()+[/color][color=#dd0000]" -diem ly: "[/color][color=#007700]+[/color][color=#0000bb]getly[/color][color=#007700]()+[/color][color=#dd0000]" -diem hoa: "[/color][color=#007700]+[/color][color=#0000bb]gethoa[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"diem trung binh: "[/color][color=#007700]+[/color][color=#0000bb]diemtb[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hoc luc: "[/color][color=#007700]+[/color][color=#0000bb]hocluc[/color][color=#007700]([/color][color=#0000bb]diemtb[/color][color=#007700])); } }[/color]
</div>
</div>
class giangvien
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package nhansu[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]giangvien [/color][color=#007700]{ private [/color][color=#0000bb]string hotengv[/color][color=#007700]; private [/color][color=#0000bb]int namsinhgv[/color][color=#007700]; private [/color][color=#0000bb]string daylop[/color][color=#007700]; private [/color][color=#0000bb]float luong[/color][color=#007700]; public [/color][color=#0000bb]void sethotengv[/color][color=#007700]([/color][color=#0000bb]string hotengv1[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hotengv [/color][color=#007700]= [/color][color=#0000bb]hotengv1[/color][color=#007700]; } public [/color][color=#0000bb]void setnamsinhgv[/color][color=#007700]([/color][color=#0000bb]int namsinhgv1[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinhgv [/color][color=#007700]= [/color][color=#0000bb]namsinhgv1[/color][color=#007700]; } public [/color][color=#0000bb]void setdaylop[/color][color=#007700]([/color][color=#0000bb]string daylop1[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]daylop [/color][color=#007700]= [/color][color=#0000bb]daylop1[/color][color=#007700]; } public [/color][color=#0000bb]void setluong[/color][color=#007700]([/color][color=#0000bb]float luong1[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luong [/color][color=#007700]= [/color][color=#0000bb]luong1[/color][color=#007700]; } public [/color][color=#0000bb]string gethotengv[/color][color=#007700]() { return [/color][color=#0000bb]hotengv[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinhgv[/color][color=#007700]() { return [/color][color=#0000bb]namsinhgv[/color][color=#007700]; } public [/color][color=#0000bb]string getdaylop[/color][color=#007700]() { return [/color][color=#0000bb]daylop[/color][color=#007700]; } public [/color][color=#0000bb]float getluong[/color][color=#007700]() { return [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]void nhapgv[/color][color=#007700](){ [/color][color=#0000bb]scanner in [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ten gv: "[/color][color=#007700]); [/color][color=#0000bb]sethotengv[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"day lop: "[/color][color=#007700]); [/color][color=#0000bb]setdaylop[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh: "[/color][color=#007700]); [/color][color=#0000bb]setnamsinhgv[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"luong: "[/color][color=#007700]); [/color][color=#0000bb]setluong[/color][color=#007700]([/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]()); } public [/color][color=#0000bb]void showgv[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"thong tin gv: "[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"ho ten: " [/color][color=#007700]+[/color][color=#0000bb]gethotengv[/color][color=#007700]()+[/color][color=#dd0000]" -day lop: "[/color][color=#007700]+[/color][color=#0000bb]getdaylop[/color][color=#007700]()); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nam sinh: " [/color][color=#007700]+[/color][color=#0000bb]getnamsinhgv[/color][color=#007700]()+ [/color][color=#dd0000]" -luong: "[/color][color=#007700]+[/color][color=#0000bb]getluong[/color][color=#007700]()); }}[/color]
</div>
</div>
class main
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package nhansu[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]nhansu [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]scanner in [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]hocsinh a [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]giangvien b [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nhaphs[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]nhapgv[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]showtt[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]showgv[/color][color=#007700](); if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getlop[/color][color=#007700]().[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getdaylop[/color][color=#007700]())){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giao vien: "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]gethotengv[/color][color=#007700]()+[/color][color=#dd0000]" day lop sinh vien: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()); } else { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giao vien: "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]gethotengv[/color][color=#007700]()+[/color][color=#dd0000]" khong day lop sinh vien: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()); } }}[/color]
</div>
</div>
-
-
-
-
11-05-2013, 07:00 AM #20Banned
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
còn bác nào theo dõi khóa học thì xem giúp bài mình với ạ. thanks
class sinhvien
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** 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.*/[/color][color=#0000bb]package nhansu[/color][color=#007700].[/color][color=#0000bb]demo[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; [/color][color=#ff8000]/**** @author systemadmin*/[/color][color=#007700]public class [/color][color=#0000bb]sinhvien [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]string lophoc[/color][color=#007700]; private [/color][color=#0000bb]float toan[/color][color=#007700], [/color][color=#0000bb]ly[/color][color=#007700], [/color][color=#0000bb]hoa[/color][color=#007700], [/color][color=#0000bb]diemtb[/color][color=#007700]; public [/color][color=#0000bb]void sethoten[/color][color=#007700]([/color][color=#0000bb]string hoten1[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten1[/color][color=#007700]; } public [/color][color=#0000bb]void setlophoc[/color][color=#007700]([/color][color=#0000bb]string lop[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]= [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]void settoan[/color][color=#007700]([/color][color=#0000bb]float toan[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]= [/color][color=#0000bb]toan[/color][color=#007700]; } public [/color][color=#0000bb]void setly[/color][color=#007700]([/color][color=#0000bb]float ly[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]= [/color][color=#0000bb]ly[/color][color=#007700]; } public [/color][color=#0000bb]void sethoa[/color][color=#007700]([/color][color=#0000bb]float hoa[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]= [/color][color=#0000bb]hoa[/color][color=#007700]; } public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getlophoc[/color][color=#007700]() { return [/color][color=#0000bb]lophoc[/color][color=#007700]; } public [/color][color=#0000bb]void setdiemtb[/color][color=#007700]() { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa[/color][color=#007700]) / [/color][color=#0000bb]3[/color][color=#007700]; } public [/color][color=#0000bb]float getdiemtb[/color][color=#007700]() { return [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]void showsv[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"
"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"họ và tên: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lớp: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lophoc[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"toán: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lý: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"hóa: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa[/color][color=#007700]); [/color][color=#0000bb]setdiemtb[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"điểm tb: " [/color][color=#007700]+ [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]()); } public [/color][color=#0000bb]void xeploai[/color][color=#007700]() { if (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]> [/color][color=#0000bb]0[/color][color=#007700]) && ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]<= [/color][color=#0000bb]5.0[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học lực tb"[/color][color=#007700]); } else if (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]> [/color][color=#0000bb]5.0[/color][color=#007700]) && ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]<= [/color][color=#0000bb]8.0[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học lực khá"[/color][color=#007700]); } else if (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]> [/color][color=#0000bb]8.0[/color][color=#007700]) && ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]<= [/color][color=#0000bb]10[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học lực giỏi"[/color][color=#007700]); } } public [/color][color=#0000bb]void inputsv[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập thông tin sinh viên!"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập tên sinh viên: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); while ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700].[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#dd0000]""[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tên sinh viên không được để trống."[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập lớp học: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); while ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lophoc[/color][color=#007700].[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#dd0000]""[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lớp học không được để trống"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm toán: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); while (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập sai"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]toan [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm lý: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); while (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập sai"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]ly [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm hóa: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); while (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập sai"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoa [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextfloat[/color][color=#007700](); } }}[/color]
</div>
</div>
class giangvien
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** 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.*/[/color][color=#0000bb]package nhansu[/color][color=#007700].[/color][color=#0000bb]demo[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]calendar[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; [/color][color=#ff8000]/**** @author systemadmin*/[/color][color=#007700]public class [/color][color=#0000bb]giangvien [/color][color=#007700]{ private [/color][color=#0000bb]string hoten[/color][color=#007700]; private [/color][color=#0000bb]string lopday[/color][color=#007700]; private [/color][color=#0000bb]int namsinh[/color][color=#007700]; private [/color][color=#0000bb]int luong[/color][color=#007700]; private [/color][color=#0000bb]int year [/color][color=#007700]= [/color][color=#0000bb]calendar[/color][color=#007700].[/color][color=#0000bb]getinstance[/color][color=#007700]().[/color][color=#0000bb]get[/color][color=#007700]([/color][color=#0000bb]calendar[/color][color=#007700].[/color][color=#0000bb]year[/color][color=#007700]); public [/color][color=#0000bb]void setgiangvien[/color][color=#007700]([/color][color=#0000bb]string hoten[/color][color=#007700], [/color][color=#0000bb]string lopday[/color][color=#007700], [/color][color=#0000bb]int namsinh[/color][color=#007700], [/color][color=#0000bb]int luong[/color][color=#007700]) { [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]hoten[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lopday [/color][color=#007700]= [/color][color=#0000bb]lopday[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]namsinh[/color][color=#007700]; [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]luong [/color][color=#007700]= [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]string gethoten[/color][color=#007700]() { return [/color][color=#0000bb]hoten[/color][color=#007700]; } public [/color][color=#0000bb]string getlopday[/color][color=#007700]() { return [/color][color=#0000bb]lopday[/color][color=#007700]; } public [/color][color=#0000bb]int getnamsinh[/color][color=#007700]() { return [/color][color=#0000bb]namsinh[/color][color=#007700]; } public [/color][color=#0000bb]int getluong[/color][color=#007700]() { return [/color][color=#0000bb]luong[/color][color=#007700]; } public [/color][color=#0000bb]void inputgv[/color][color=#007700]() { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhập thông tin giảng viên!"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập tên giảng viên: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); while ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten[/color][color=#007700].[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#dd0000]""[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"tên giảng viên không được để trống"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập lớp dạy: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lopday [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); while ([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lopday[/color][color=#007700].[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#dd0000]""[/color][color=#007700])) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"lớp dạy không được để trống"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lopday [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); } [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập năm sinh: "[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextint[/color][color=#007700](); while (([/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]year [/color][color=#007700]- [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"năm sinh không hợp lệ"[/color][color=#007700]); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]).[/color][color=#0000bb]nextline[/color][color=#007700](); } }}[/color]
</div>
</div>
class qlnhansu
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]/** 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.*/[/color][color=#0000bb]package nhansu[/color][color=#007700].[/color][color=#0000bb]demo[/color][color=#007700]; [/color][color=#ff8000]/**** @author systemadmin*/[/color][color=#007700]public class [/color][color=#0000bb]qlnhansu [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]sinhvien a [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/color][color=#007700](); [/color][color=#0000bb]giangvien b [/color][color=#007700]= new [/color][color=#0000bb]giangvien[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]inputsv[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]inputgv[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]showsv[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]xeploai[/color][color=#007700](); if ([/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getlopday[/color][color=#007700]().[/color][color=#0000bb]equals[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getlophoc[/color][color=#007700]())) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giảng viên " [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]() + [/color][color=#dd0000]" dạy lớp của sinh viên " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]gethoten[/color][color=#007700]()); } }}[/color]
</div>
</div>
"căn do xuất tinh ngược này do lượng đường cao dẫn tới thương tổn dây thần kinh tại các cơ vòng khiến người bệnh bị xuất tinh ngược. thường ngày, khi xuất tinh thì cơ thắt cổ bọng đái đóng lại để...
Nguyên nhân và giải pháp cho tình trạng không xuất tinh ở phái mạnh?