-
09-07-2014, 07:00 AM #31Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>bài tập về nhà (move your mouse to reveal the content)</noscript>
bài tập về nhà (open)
bài tập về nhà (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package baitapvenha[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]text[/color][color=#007700].[/color][color=#0000bb]simpledateformat[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]date[/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]/**** bài 1: tạo lớp hàng hóa gồm: tên hàng, mã hàng, giá hàng, số lượng. nếu mua* vào khoảng 8h -> 17h hàng ngày , được giảm giá 5% tạo phương thức tính tổng* tiền. tạo 1 đối tượng, nhập các giá trị từ màn hình console. in toàn bộ thông* tin đơn hàng ra ngoài màn hình console gồm: tên, mã, giá, số lượng, thời gian* mua.*/[/color][color=#007700]public class [/color][color=#0000bb]buoi14 [/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]hanghoa hh [/color][color=#007700]= new [/color][color=#0000bb]hanghoa[/color][color=#007700](); [/color][color=#0000bb]hh[/color][color=#007700].[/color][color=#0000bb]nhap[/color][color=#007700](); [/color][color=#0000bb]hh[/color][color=#007700].[/color][color=#0000bb]showinfor[/color][color=#007700](); }} class [/color][color=#0000bb]hanghoa[/color][color=#007700]{ public [/color][color=#0000bb]string tenhang[/color][color=#007700],[/color][color=#0000bb]mahang[/color][color=#007700]; public [/color][color=#0000bb]float giahang[/color][color=#007700]; public [/color][color=#0000bb]int soluong[/color][color=#007700]; public [/color][color=#0000bb]void nhap[/color][color=#007700]() { [/color][color=#0000bb]scanner sc [/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]"ma hang : "[/color][color=#007700]);[/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"ten hang: "[/color][color=#007700]);[/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"so luong: "[/color][color=#007700]);[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"don gia : "[/color][color=#007700]);[/color][color=#0000bb]giahang [/color][color=#007700]= [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]close[/color][color=#007700](); } public [/color][color=#0000bb]void sale[/color][color=#007700]() { [/color][color=#0000bb]date time [/color][color=#007700]= new [/color][color=#0000bb]date[/color][color=#007700](); [/color][color=#ff8000]//khai bao dinh dang ngay va thang [/color][color=#0000bb]simpledateformat dinhdangtime [/color][color=#007700]= new [/color][color=#0000bb]simpledateformat[/color][color=#007700]([/color][color=#dd0000]"hh:mm:ss"[/color][color=#007700]); [/color][color=#0000bb]string hienthitime [/color][color=#007700]= [/color][color=#0000bb]dinhdangtime[/color][color=#007700].[/color][color=#0000bb]format[/color][color=#007700]([/color][color=#0000bb]time[/color][color=#007700]); [/color][color=#0000bb]string hienthisale[/color][color=#007700][] =[/color][color=#0000bb]hienthitime[/color][color=#007700].[/color][color=#0000bb]split[/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]"
time: "[/color][color=#007700]+[/color][color=#0000bb]hienthitime[/color][color=#007700]); if([/color][color=#0000bb]8[/color][color=#007700]<=[/color][color=#0000bb]integer[/color][color=#007700].[/color][color=#0000bb]parseint[/color][color=#007700]([/color][color=#0000bb]hienthisale[/color][color=#007700][[/color][color=#0000bb]0[/color][color=#007700]])&&[/color][color=#0000bb]integer[/color][color=#007700].[/color][color=#0000bb]parseint[/color][color=#007700]([/color][color=#0000bb]hienthisale[/color][color=#007700][[/color][color=#0000bb]0[/color][color=#007700]])<=[/color][color=#0000bb]17[/color][color=#007700]){ [/color][color=#0000bb]giahang [/color][color=#007700]= [/color][color=#0000bb]giahang [/color][color=#007700]- [/color][color=#0000bb]giahang[/color][color=#007700]*[/color][color=#0000bb]5[/color][color=#007700]/[/color][color=#0000bb]100[/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ờ vàng giảm giá 5% !"[/color][color=#007700]); } } public [/color][color=#0000bb]float tongtien[/color][color=#007700]() { [/color][color=#0000bb]sale[/color][color=#007700](); return [/color][color=#0000bb]giahang [/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]; } public [/color][color=#0000bb]void showinfor[/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]"mahang\ttenhang\tsoluong\tdongia\tthanhtien "[/color][color=#007700]+[/color][color=#0000bb]mahang[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]tenhang[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]soluong[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]giahang[/color][color=#007700]+[/color][color=#dd0000]"\t"[/color][color=#007700]+[/color][color=#0000bb]tongtien[/color][color=#007700]()); }}[/color]
</div>
</div>
-
01-06-2015, 07:00 AM #32Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
nộp bài
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>bài 1 (move your mouse to reveal the content)</noscript>
bài 1 (open)
bài 1 (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
package lesson14[/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]; class [/color][color=#0000bb]hanghoa [/color][color=#007700]{ [/color][color=#0000bb]scanner scan01 [/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]); private [/color][color=#0000bb]string tenhang [/color][color=#007700]; private [/color][color=#0000bb]string mahang[/color][color=#007700]; public [/color][color=#0000bb]long giahang[/color][color=#007700]; public [/color][color=#0000bb]int soluong[/color][color=#007700]; private [/color][color=#0000bb]byte thoigian[/color][color=#007700]; public [/color][color=#0000bb]void enter[/color][color=#007700](){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap ten hang : "[/color][color=#007700]); [/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]scan01[/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 ma hang : "[/color][color=#007700]); [/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]scan01[/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 gia hang : "[/color][color=#007700]); [/color][color=#0000bb]giahang [/color][color=#007700]= [/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextlong[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap so luong : "[/color][color=#007700]); [/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); do { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap thoi gian mua : "[/color][color=#007700]); [/color][color=#0000bb]thoigian [/color][color=#007700]= [/color][color=#0000bb]scan01[/color][color=#007700].[/color][color=#0000bb]nextbyte[/color][color=#007700](); }while (([/color][color=#0000bb]thoigian [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]thoigian[/color][color=#007700]>[/color][color=#0000bb]24[/color][color=#007700])); } public [/color][color=#0000bb]long tongtien[/color][color=#007700]([/color][color=#0000bb]long giahang [/color][color=#007700], [/color][color=#0000bb]long soluong[/color][color=#007700]) { if (([/color][color=#0000bb]thoigian [/color][color=#007700]> [/color][color=#0000bb]8[/color][color=#007700]) && ([/color][color=#0000bb]thoigian [/color][color=#007700]<[/color][color=#0000bb]17[/color][color=#007700])) { return ([/color][color=#0000bb]long[/color][color=#007700]) ([/color][color=#0000bb]giahang[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]*[/color][color=#0000bb]0.95[/color][color=#007700]); }else{ return [/color][color=#0000bb]giahang[/color][color=#007700]*[/color][color=#0000bb]soluong[/color][color=#007700]; } } public [/color][color=#0000bb]void inhoadon[/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]"day la hoa don"[/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]"ten hang hoa : " [/color][color=#007700]+ [/color][color=#0000bb]tenhang[/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]"ma hang : " [/color][color=#007700]+ [/color][color=#0000bb]mahang[/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]"gia hang : "[/color][color=#007700]+ [/color][color=#0000bb]giahang[/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]"so luong : " [/color][color=#007700]+ [/color][color=#0000bb]soluong[/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]"thoi gian mua : "[/color][color=#007700]+[/color][color=#0000bb]thoigian[/color][color=#007700]); }} public class [/color][color=#0000bb]lesson14 [/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]hanghoa a [/color][color=#007700]= new [/color][color=#0000bb]hanghoa[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]enter[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]inhoadon[/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]"tong tien : "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]tongtien[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giahang[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700])); } }[/color]
</div>
</div>
-
01-17-2015, 07:00 AM #33Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
public class bai1_unit14 {
public static void main(string[] args) {
hanghoa a1 = new hanghoa();
a1.nhap();
a1.show();
}
}
class hanghoa {
public string ten;
public string ma;
public double gia;
public int soluong;
public int time;
public void nhap() {
scanner input = new scanner(system.in);
system.out.print("ten hang hoa:");
ten = input.nextline();
system.out.print("ma hang hoa:");
ma = input.nextline();
system.out.print("gia hang hoa:");
gia = input.nextdouble();
system.out.print("so luong hang hoa:");
soluong = input.nextint();
do {
system.out.println("thoi gian mua hang:");
time = input.nextint();
} while((time < 0) && (time > 24));
if(time >= 8 && time <=17) {
system.out.println("gia hang hoa da duoc giam 5% khi mua "
+ "trong khoang thoi gian 8h -> 17h");
gia = gia*0.95;
}
}
public void show() {
system.out.println("don hang da mua");
system.out.println("ten:" + ten);
system.out.println("ma:" + ma);
system.out.println("gia:" + gia);
system.out.println("so luong:" + soluong);
system.out.println("thoi gian mua:" + time);
system.out.println("tong thiet hai:" + sum());
}
public double sum() {
return gia*soluong;
}
}
[/code]
-
03-06-2015, 07:00 AM #34Junior Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>bài làm (move your mouse to reveal the content)</noscript>
bài làm (open)
bài làm (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; class [/color][color=#0000bb]hanghoa [/color][color=#007700]{public [/color][color=#0000bb]string tenhang[/color][color=#007700];public [/color][color=#0000bb]string mahang[/color][color=#007700];public [/color][color=#0000bb]int giahang[/color][color=#007700];public [/color][color=#0000bb]int soluong[/color][color=#007700];public [/color][color=#0000bb]int giomuahang[/color][color=#007700]; public [/color][color=#0000bb]void showthongtin[/color][color=#007700]([/color][color=#0000bb]string ten[/color][color=#007700], [/color][color=#0000bb]string ma[/color][color=#007700], [/color][color=#0000bb]int gia[/color][color=#007700], [/color][color=#0000bb]int sl[/color][color=#007700], [/color][color=#0000bb]int gm[/color][color=#007700]) {[/color][color=#0000bb]scanner nhapdl [/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]"
thông tin mua hàng : "[/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 hàng : " [/color][color=#007700]+ [/color][color=#0000bb]ten[/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]"mã : " [/color][color=#007700]+ [/color][color=#0000bb]ma[/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á : " [/color][color=#007700]+ [/color][color=#0000bb]gia [/color][color=#007700]+ [/color][color=#dd0000]" đồng"[/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]"số lượng : " [/color][color=#007700]+ [/color][color=#0000bb]sl[/color][color=#007700]);if ([/color][color=#0000bb]gm [/color][color=#007700]>= [/color][color=#0000bb]8 [/color][color=#007700]&& [/color][color=#0000bb]gm [/color][color=#007700]<= [/color][color=#0000bb]17[/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ổng tiền phải trả : " [/color][color=#007700]+ [/color][color=#0000bb]gia [/color][color=#007700]* [/color][color=#0000bb]sl [/color][color=#007700]* [/color][color=#0000bb]0.95[/color][color=#007700]+ [/color][color=#dd0000]" đồng"[/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]"được giảm 5%"[/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]"tổng tiền phải trả : " [/color][color=#007700]+ [/color][color=#0000bb]gia [/color][color=#007700]* [/color][color=#0000bb]sl [/color][color=#007700]+ [/color][color=#dd0000]" đồng"[/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]"không được giảm giá"[/color][color=#007700]);} }} public class [/color][color=#0000bb]bai14_3_static [/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]hanghoa a [/color][color=#007700]= new [/color][color=#0000bb]hanghoa[/color][color=#007700]();[/color][color=#0000bb]scanner nhapdl [/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]"nhập tên hàng : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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 mã hàng : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/color][color=#007700].[/color][color=#0000bb]next[/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 giá hàng : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giahang [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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 số lượng : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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 thời gian mua : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giomuahang [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]();while ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giomuahang [/color][color=#007700]<= [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giomuahang [/color][color=#007700]>= [/color][color=#0000bb]24[/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]"vui lòng chỉ nhập từ 0h đến 24h"[/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ại : "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giomuahang [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]();}[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]showthongtin[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]tenhang[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]mahang[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giahang[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]soluong[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]giomuahang[/color][color=#007700]); }}[/color]
</div>
</div>
-
03-02-2016, 07:00 AM #35Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>open (move your mouse to reveal the content)</noscript>
open (open)
open (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]text[/color][color=#007700].[/color][color=#0000bb]simpledateformat[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]date[/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]; class [/color][color=#0000bb]hanghoa [/color][color=#007700]{ public static [/color][color=#0000bb]string tenhang[/color][color=#007700]; public static [/color][color=#0000bb]int mahang[/color][color=#007700]; public static [/color][color=#0000bb]int giahang[/color][color=#007700]; public static [/color][color=#0000bb]int soluong[/color][color=#007700]; public static [/color][color=#0000bb]int tongtien[/color][color=#007700]([/color][color=#0000bb]int giahang[/color][color=#007700], [/color][color=#0000bb]int soluong[/color][color=#007700]) { return ([/color][color=#0000bb]giahang [/color][color=#007700]* [/color][color=#0000bb]soluong[/color][color=#007700]); } public static [/color][color=#0000bb]void showhoadon[/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 hang :" [/color][color=#007700]+ [/color][color=#0000bb]tenhang[/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]"ma hang :" [/color][color=#007700]+ [/color][color=#0000bb]mahang[/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]"soluong hang :" [/color][color=#007700]+ [/color][color=#0000bb]soluong[/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]"tong tien hang :" [/color][color=#007700]+ [/color][color=#0000bb]tongtien[/color][color=#007700]([/color][color=#0000bb]giahang[/color][color=#007700], [/color][color=#0000bb]soluong[/color][color=#007700])); if ([/color][color=#0000bb]thoigian[/color][color=#007700]() >= [/color][color=#0000bb]8 [/color][color=#007700]&& [/color][color=#0000bb]thoigian[/color][color=#007700]() <= [/color][color=#0000bb]17[/color][color=#007700]) { [/color][color=#0000bb]int n [/color][color=#007700]= [/color][color=#0000bb]tongtien[/color][color=#007700]([/color][color=#0000bb]giahang[/color][color=#007700], [/color][color=#0000bb]soluong[/color][color=#007700]); [/color][color=#0000bb]int m [/color][color=#007700]= ([/color][color=#0000bb]n [/color][color=#007700]* [/color][color=#0000bb]5 [/color][color=#007700]/ [/color][color=#0000bb]100[/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]"khuyen mai la " [/color][color=#007700]+ [/color][color=#0000bb]m[/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]"so tien phai tra " [/color][color=#007700]+ ([/color][color=#0000bb]n [/color][color=#007700]- [/color][color=#0000bb]m[/color][color=#007700])); } } public static [/color][color=#0000bb]int thoigian[/color][color=#007700]() { [/color][color=#0000bb]date thoigian [/color][color=#007700]= new [/color][color=#0000bb]date[/color][color=#007700](); [/color][color=#0000bb]simpledateformat dinhdangthoigian [/color][color=#007700]= new [/color][color=#0000bb]simpledateformat[/color][color=#007700]([/color][color=#dd0000]"hh"[/color][color=#007700]); [/color][color=#0000bb]string m [/color][color=#007700]=[/color][color=#0000bb]dinhdangthoigian[/color][color=#007700].[/color][color=#0000bb]format[/color][color=#007700]([/color][color=#0000bb]thoigian[/color][color=#007700].[/color][color=#0000bb]gettime[/color][color=#007700]()); [/color][color=#0000bb]int t[/color][color=#007700]=[/color][color=#0000bb]integer[/color][color=#007700].[/color][color=#0000bb]parseint[/color][color=#007700]([/color][color=#0000bb]m[/color][color=#007700]); return [/color][color=#0000bb]t[/color][color=#007700]; }} public class [/color][color=#0000bb]demophuongthuc [/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 sc [/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]"nhap ten hang "[/color][color=#007700]); [/color][color=#0000bb]hanghoa[/color][color=#007700].[/color][color=#0000bb]tenhang [/color][color=#007700]= [/color][color=#0000bb]sc[/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 ma hang "[/color][color=#007700]); [/color][color=#0000bb]hanghoa[/color][color=#007700].[/color][color=#0000bb]mahang [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"nhap soluong hang "[/color][color=#007700]); [/color][color=#0000bb]hanghoa[/color][color=#007700].[/color][color=#0000bb]soluong [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"nhap gia hang "[/color][color=#007700]); [/color][color=#0000bb]hanghoa[/color][color=#007700].[/color][color=#0000bb]giahang [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"----------------------------------------------------"[/color][color=#007700]); [/color][color=#0000bb]hanghoa[/color][color=#007700].[/color][color=#0000bb]showhoadon[/color][color=#007700](); }} [/color]
</div>
</div>
-
05-22-2016, 07:00 AM #36Senior Member
- Ngày tham gia
- Aug 2015
- Bài viết
- 129
thời gian lấy từ hệ thống nhé bạn, không phải bắt chủ mua nhập, vì nếu lỡ 1 phút thì chủ mua cũng ăn gian
-
05-22-2016, 07:00 AM #37Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>btvn (move your mouse to reveal the content)</noscript>
btvn (open)
btvn (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote></blockquote></div>
</div>
</div>
Một trong những điểm mạnh của Công ty TNHH SX TM Thép Đông Anh chính là sự linh hoạt trong việc đáp ứng nhu cầu đa dạng của khách hàng. Chúng tôi hiểu rằng mỗi công trình xây dựng đều có những yêu...
Lưới thép hàn Đông Anh - Được các nhà thầu tin cậy và lựa chọn