-
08-27-2013, 07:00 AM #41Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
Mã:/* * to change this template, choose tools | templates * and open the template in the editor. */ package edu.buidu.java; import java.util.scanner; /** * * @author buidu_sse */ public class demo { public static void main(string[] args) { string ten; int tuoi ; int diemtoan ; int diemly ; int diemhoa; scanner nhaplieu = new scanner(system.in); system.out.print("nhập vào tên hs: "); ten = nhaplieu.nextline(); system.out.print("nhập vào tuổi hs: "); tuoi = nhaplieu.nextint(); system.out.print("nhập vào điểm toán: "); diemtoan = nhaplieu.nextint(); system.out.print("nhập vào điểm hóa: "); diemhoa = nhaplieu.nextint(); system.out.print("nhập vào điểm lý: "); diemly = nhaplieu.nextint(); system.out.println("---- thong tin hs vua nhap la ------"); system.out.println("tên: " + ten); system.out.println("tuoi: " + tuoi); system.out.println("điểm toán: " + diemtoan); system.out.println("điểm hóa: " + diemly); system.out.println("điểm lý: " + diemhoa); int dtb = (diemtoan + diemly + diemhoa) / 3; system.out.println("điểm tb: " + dtb); if (dtb > 9) { system.out.println("xl: hssx"); } else { if (dtb > 7.5) { system.out.println("xl: hsg"); } else { if (dtb >= 7) { system.out.println("sl: hsk"); } else { if (dtb >= 5) { system.out.println("xl: hstb"); } else { system.out.println("xl: hsy"); } } } } } }
-
08-27-2013, 07:00 AM #42Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
ở trên có nhiều bạn làm tốt rồi, bạn có thể tham khảo code của họ xem, bạn chạy đúng và so sánh cách làm với họ xem thế nào ^^
-
08-30-2013, 07:00 AM #43Junior Member
- Ngày tham gia
- Mar 2014
- Bài viết
- 0
<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 structuredemo[/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]entrydemo [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string args [/color][color=#007700][]){ [/color][color=#ff8000]// enter the name and phone number of the any object. [/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]string name[/color][color=#007700]; [/color][color=#0000bb]string address[/color][color=#007700]; [/color][color=#0000bb]string school[/color][color=#007700]; [/color][color=#0000bb]int phonenumber[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"enter of your name!"[/color][color=#007700]); [/color][color=#0000bb]name [/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]"enter your address:"[/color][color=#007700]); [/color][color=#0000bb]address [/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]"enter your school:"[/color][color=#007700]); [/color][color=#0000bb]school [/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]"enter of your phone number!"[/color][color=#007700]); [/color][color=#0000bb]phonenumber [/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]"your name's:"[/color][color=#007700]+[/color][color=#0000bb]name[/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]"your phone number's:"[/color][color=#007700]+[/color][color=#0000bb]phonenumber[/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]"your address:"[/color][color=#007700]+[/color][color=#0000bb]address[/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]"your school: "[/color][color=#007700]+[/color][color=#0000bb]school[/color][color=#007700]); }[/color][color=#ff8000]// end the methodmain.[/color][color=#007700]}[/color][color=#ff8000]//end the classentrydemo.[/color]
</div>
</div>
-
08-30-2013, 07:00 AM #44Junior Member
- Ngày tham gia
- Apr 2014
- Bài viết
- 0
<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 structuredemo[/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]scoredemo [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string args [/color][color=#007700][]){ [/color][color=#ff8000]//entry name,year of birth,score of the math, phisics, chemistry. [/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]string name[/color][color=#007700], [/color][color=#0000bb]year[/color][color=#007700]; [/color][color=#0000bb]float math[/color][color=#007700], [/color][color=#0000bb]phisics[/color][color=#007700], [/color][color=#0000bb]chemistry[/color][color=#007700]; [/color][color=#0000bb]float average[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"enter the your name: "[/color][color=#007700]); [/color][color=#0000bb]name [/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]"enter the year of birth:"[/color][color=#007700]); [/color][color=#0000bb]year [/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]"enter score of the math"[/color][color=#007700]); [/color][color=#0000bb]math [/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]"enter score of the phisics!"[/color][color=#007700]); [/color][color=#0000bb]phisics [/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]"enter score of the chemistry!"[/color][color=#007700]); [/color][color=#0000bb]chemistry [/color][color=#007700]= [/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#ff8000]// declare! it very simple! [/color][color=#0000bb]average [/color][color=#007700]= ([/color][color=#0000bb]math[/color][color=#007700]+[/color][color=#0000bb]phisics[/color][color=#007700]+[/color][color=#0000bb]chemistry[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; if([/color][color=#0000bb]average [/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]"wonderful! woa!woa!"[/color][color=#007700]); else if( [/color][color=#0000bb]average[/color][color=#007700]>=[/color][color=#0000bb]7 [/color][color=#007700]|| [/color][color=#0000bb]average[/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]"good job! okay! i'm very happy!"[/color][color=#007700]); else if( [/color][color=#0000bb]average[/color][color=#007700]>=[/color][color=#0000bb]5 [/color][color=#007700]|| [/color][color=#0000bb]average[/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]"great! you is beautiful!"[/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]"keep trying! i think so! hihi"[/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]"we are champian!"[/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]"write by:"[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]"\tyear of birth"[/color][color=#007700]+[/color][color=#0000bb]year[/color][color=#007700]); }[/color][color=#ff8000]//end the methodmain.[/color][color=#007700]}[/color][color=#ff8000]//end the classscoredemo.[/color]
</div>
</div>
-
09-02-2013, 07:00 AM #45Junior Member
- Ngày tham gia
- Apr 2014
- Bài viết
- 0
minh nop bai:
Mã:package bai1; import java.util.scanner; public class bai1 { public static void main(string[] args) { string ten; float ns,t,l,h,tb,g,k,tb,y; scanner nhap=new scanner(system.in); system.out.println("nhap ten hoc sinh: "); ten=nhap.nextline(); system.out.println("nhap nam sinh: "); ns=nhap.nextfloat(); system.out.println("nhap diem toan: "); t=nhap.nextfloat(); system.out.println("nhap diem ly :"); l=nhap.nextfloat(); system.out.println("nhap diem hoa: "); h=nhap.nextfloat(); tb=((t+l+h)/3); system.out.println("diem trung binh cua sv la:"+tb); if(tb>=8) { system.out.println("sinh vien dat hoc luc gioi!!!"); } else if(tb<8&&tb>=6.5) { system.out.println("sinh vien dat hoc luc kha!!!"); } else if(tb<6.5&&tb>=5) { system.out.println("sinh vien dat hoc luc trung binh!!!"); } else { system.out.println("sinh vien dat hoc luc yeu!!!"); } } }
-
09-02-2013, 07:00 AM #46Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
package baihoc7[/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]baihoc7 [/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]long nam[/color][color=#007700]; [/color][color=#0000bb]float tb[/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]string ten[/color][color=#007700]; [/color][color=#0000bb]scanner nhapdulieu [/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].print([/color][color=#dd0000]"nhap ho va ten:"[/color][color=#007700]); [/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/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]"nhap nam sinh:"[/color][color=#007700]); [/color][color=#0000bb]nam[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextlong[/color][color=#007700](); if ([/color][color=#0000bb]nam[/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]" ban nhap sai nam:"[/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]" nhap toan, ly, hoa:"[/color][color=#007700]); [/color][color=#0000bb]toan[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]ly[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]hoa[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if ((([/color][color=#0000bb]toan [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700])||([/color][color=#0000bb]toan [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) || (([/color][color=#0000bb]ly [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]) || ([/color][color=#0000bb]ly [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700])) || (([/color][color=#0000bb]hoa [/color][color=#007700]< [/color][color=#0000bb]0 [/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 điểm:"[/color][color=#007700]); }else { [/color][color=#0000bb]tb [/color][color=#007700]= (float) ([/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]; [/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 trung bình 3 môn: " [/color][color=#007700]+ [/color][color=#0000bb]tb[/color][color=#007700]); if ([/color][color=#0000bb]tb[/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]"xep loai gioi"[/color][color=#007700]); }else if ([/color][color=#0000bb]tb[/color][color=#007700]>[/color][color=#0000bb]6.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]"xep loai kha"[/color][color=#007700]); }else if ([/color][color=#0000bb]tb[/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]"xep loai trung binh"[/color][color=#007700]); }else if ([/color][color=#0000bb]tb[/color][color=#007700]>[/color][color=#0000bb]3.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]"xep loai yeu"[/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]"xep loai kem "[/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></blockquote></div>
</div>
</div>
-
09-03-2013, 07:00 AM #47Junior Member
- Ngày tham gia
- Dec 2014
- Bài viết
- 0
bài của bạn rất tốt. bạn có thể code cho sáng sủa thêm nữa thì tuyệt với.... hì
-
09-03-2013, 07:00 AM #48Junior Member
- Ngày tham gia
- Mar 2014
- Bài viết
- 0
s
Gửi bởi tuan kiet
bạn đọc hướng dẫn đưa source code của mình vào thẻ php cho đẹp, hihi.
-
09-03-2013, 07:00 AM #49Junior Member
- Ngày tham gia
- Sep 2014
- Bài viết
- 0
Gửi bởi hohoaikiet
-
09-07-2013, 07:00 AM #50Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
<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ã:import java.util.scanner; public class bai02 { public static void main(string[]args){ string hoten; float ns,t,l,h; float tb; scanner in=new scanner(system.in); system.out.println("nhap ho ten:"); hoten=in.nextline(); system.out.println("nam sinh "); ns=in.nextfloat(); system.out.println("diem toan "); t=in.nextfloat(); system.out.println("diem ly "); l=in.nextfloat(); system.out.println("diem hoa "); h=in.nextfloat(); tb=(float)(t+l+h)/3; if(t>=8.0) { system.out.println("day la hs gioi"); } if(t<8.0 && t>=6.5) { system.out.println("day la hs kha"); } if(t<6.5) { system.out.println("day la hs trung binh"); } } }
</div>
</div>
Khu dự án Diamond Alnata Plus phát triển bởi Gamuda Land thiết kế hợp lý nằm trung tâm thông gió tự nhiên. Diamond Alnata Plus Tân Phú thiết kế hợp lý sống đích thực ngay giữa trung tâm. Căn hộ cách...
Khu dự án Diamond Alnata Plus giáp trung tâm