BO GIAO D1)C vA BAo T~O TRUONG BH NGOAI NGU - TIN HQC TP HCM KHOA CONG NGHB THONG TIN \ , - J: .- KHOA LUAN TOT NGHIEP • • xlY DUNG • l' TRO CHOI , MONOPOL Y TREN MANG • Giang vien hU'6'ngdfin: Ths Vii Thanh Hi~n Sinh vien th\fc hi~n: Nguy~n HAng Mai Nguy~n N gQC Mai TP HO CHi MINH - 2009 J Chung em xin chan dun an Khoa Cong Ngh~ Thong Tin truang D~i HQc Dan L~p Ngo~i Ngfr Tin HQc TP.HCM da: t~o diSu ki~n cho chung em th\l'c hi~n t6t kh6a lu~n Chung em cling xin tran trQng danh nhfrng lai d~u tien d~ to long bi~t an sau s~c nh~t d~n ThS v-o THANH HIEN da: t?n tinh chi bao dinh huang giup chung em r~t nhiSu su6t thai gian th\l'c hi~n dS tai Chung em cling xin chan cam an guy th~y co khoa da: t~n tinh giang d~y, trang bi cho chung em nhling ki~n thuc c~n thi~t su6t qua trinh hQc t~p t~i truang, va cling xin duQ'c gll'i long bi~t an sau s~c d~n cha m~, cac anh chi, b~n be da: ling hQ, giup va dQng vien chung em nhli'ng luc kh6 khan cling nhu su6t nhu'ng nam hQc Vtl'a qua M~c du da: c6 g~ng hoan dS tai vai t~t ca n6 I\-l'CClla ban than, nhung dS tai Clla chung em ch~c ch~n khong th~ tranh duQ'c nhu'ng thi~u s6t nh~t dinh, kfnh mong S\l' thong cam va t~n tinh chi bao Clla quy th~y co - - - - - xA Y DVNG TRO CHOI MONOPOL Y TREN MI;\NG MUCLUC • • C0lW03 Ml)C Ll)C Clmo'ng TONG QUAN TRO CHOI MONOPOLY 1.1 Gi6i thi~u v~ tro choi Monopoly 1.1.1 Cach th~ng Monopoly 1.1.2 Thi~t bi 1.1.3 51,!' chu~1l bi 1.1.4 Chll ngan hang 1.1.5 Ngan Hang 1.1.6 Lu?t choi Monopoly 1.2 Xay dt,rng tro choi Monopoly tren m"mg 1.2.1 Khao sat 1.2.2 Phan tich I 2.3 Th i~t k~ I 2.4 Cai d~t ChU'o'ng PHAN TICH 2.1 50 d6 Use-case 2.2 Danh sach cac Actor va m\IC tieu 2.3 Danh sach cac Use-case 2.4 8~c ta Use-case 2.4.1 UCO I: T(;lo Phong Choi 2.4.2 UC02: Thoat 2.4.3 UC03: Tham Gia Phong ChO'i 2.4 UC04: Tan G~u 2.4.5 UC05 : Xem Thong Tin 2.4.6 UC06: M ua 8~t 2.4.7 UC07: M ua Nha 2.4.8 UC08: Mua Dich Y\l 2.4.9 UC09: Mua B~n Xe 2.4.10 UCIO: Tung Xi Ng~u 2.4.11 UC II : Chuy~n LUQ1 2.4 12 UC 12: Rut the 2.4.13 UC 13: Ban 8~t 2.4.14 UCI4: Ban Dich Y\l 2.4.15 UC 14: Ban B~n Xe 2.4.16 UC 16: Ban Nha 2.4.17 UC 17: Thay 86i Lu?t Choi 2:5-: -5 B-86-L:6~=.~.= ~ GVHD: Ths.VO THANH HIEN 3 6 23 23 23 23 23 = 24 24 24 26 26 27 27 28 28 28 29 29 30 30 32 32 33 33 34 34 -;:~:-:-:-.~: -:-.35- - 36 SVTH: HONG MAl - NGOC MAl , , , • xA Y DVNG TRO CHOI MONOPOL Y TREN M;; NG 2.6 SO' 06 Seq uenee 2.6.1 Tnut cao nh~t se b~t d~u chai Nguai chai d~t the bai vaG "B~t £)~u", tung Xl ng~u va di chuy~n the bai huang theo mui ten qua sf> tuang ung vai sf>nut Ctta Xl ng~u Sau do, nguai chai d5 hoan t~t luqt chai cua mInh, tai lugt ehai k~ tit?p The biti v~n giu nguyen tren vi tri va dugc xu Iy ttl' di~m cho nguai chai luqt k~ ti~p Hai ho~c nhi~u the bai han co Ie dung I~i cung mQt vi tri va cung thai gian T~i mQt vi tri nai rna the bai ctta nguai chai chi~m giu', nguai chai co th~ mua vung d~t ho~c nhung tai san khac, ho~c ep bUQc phai tn1 ti~n thue, ti~n thu~, ho~c la rai VaG6 Ca HQi ho~c Khi V~n, Vao Tu, N~u nguai chai dugc nut d6i nguai chai se dugc tung them I~n mIa N~u nguo'i chai lien ti~p tung dugc l~n nut d6i thl nguai chai bi VaGtu GVHD: Ths.VO- THANH HIEN _ _._ • SVTH: Hq~.G J\1AI - NGQC MAl xA Y nt/NG TRO CHdl MONOPOLY TREN M~NG , " 1.1.6.1 Bat dau eu rn6i l~n the bai cua nguai chai di qua () "B~t f)~u", Ngan Hang se tnl cho nguai chai rnQt khoang tiSn Vi d\l: $200 B~t f)~u 1.1.6.2 Mua baD tili SaD BAt cu.khi nao nguai chai cling co thS rnua tai san ill Ngan Hang theo gia dff dugc dinh s~n N~u nguai chai kh{)ng rnu6n rnua ffii san thi cling co thS ban dAu gia tai san Nguai rnua se tra tiSn cho Ngan Hang BAt ky nguai chai nao, kS ca nhiing nguai rna til ch6i rnua dAt cling co thS gia Sv tra gia t~i cUQc ban dAu gia co thS dugc b~t d~u vai bAt ki gia nao GVHD: Ths.VU THANH HIEN SVTH: HONG MAl - NG C MAl xi\ Y DVNG TRO CHOf MONOPOLY TREN MANG • ~ I Lo'p Dat • ODat -loDat : LoDa t -soCanNhaTo iDa: Interger -giaMuaODat : Interger -giaMuaNha : Interger -giaThueDat : Interger -soCanNhaHi enTai : Interger -soCanNhaTr uoc : Interger -nguoiSoHuu : NguoiChoi -conTrong : B oolean -giaThueNha Interger +ODatO +ODat(giaMu aDat: Interger, conTrong: Boolean, giaMuaNha: I nterger, soCanNhaToiDa: Interger, soCanNhaHie nTai: Interger, soCanNhaTruoc: Interger, giath ueDat: Interger, giaThueNha: Interger, loDat: LoDat, nguoiSoHuu: NguoiChoi) ~ - • Lo'p D~u Xe Mi~ n Phi ODauXeMienPhi -phiDauXe: I nter er +ODauXeMi enPhiO +OdauXeMie nPhi(phiDauXe: Interger) " ~ GVHD: Ths.VU THANH HIEN 66 XA Y DVNG TRO CHOI MONOPOLY • Lo'p Djch TREN MANG V••• ODichVu • -giaMu a: Interger -giaTh ue: Interger -conTr ong: Boolean -nguol SoHuu: NguoiChoi +Odic hVuO +Odic hVu(giaMua: Interger, giaThue: Interger, nguoiS oHuu: NguoiChoi) • ~ J: Lo'p Ben X e OBenXe -giaMu a: Interger -conTro ng: Boolean -nguoiS oHuu: NguoiChoi +Oben XeO +Oben Xe(giaMua: Interger, conTrong: ConTrong, nguoiS oHuu: NguoiChoi) • • Lo'p Tham Til OThamTu I +OTha • Lo'p mTuO The OThe I +OThe( ) • ,~ GVHD: Ths.VU THAN H HIEN 67 SVTH: HONG MAl -NGQC MAl xA y • • ~ m/NG TRO CHOI MONOPOLY TREN MANG J Lo'p Thue D~c Bi~t OThueDacbiet -tienDon gThue: Interger +Othue DacBietO Interger) +Othue DacBiet(tienOongThue: • Lo'p Thu~ Thu Nh~p OThueThuNha -tienDon gThue: Interger +OThue ThuNhapO Interger) +OThue ThuNhap(tienOongThue: • Lo'p Vito T OVaoTu +OVaoT • • uO Lo'p La Dfit LoDat -mau: St rmg -soODat : Interger -viTriLo Dat: Interger -mangO Oat: Odat +LoOat( ) +LoDat( mau: String, soODat: Interger, viTriLoDat: Interger) ~ HHIEN GVHD: Ths.VU _ _ .-.m._ .~ THAN 68 ~Y.I!!: !!Q.~9.M:t.\! : ~gQ~ MAI xA Y Dl)NG • TRO (HOI MONOPOLY TREN MANG Lo'p Lu'o1 Hi LuotDi -num: Interger +LuotDiO • Lo'p Du' Li~u Tru' Tuy~ n DuLieuTrucTu -duLieu: static Arra yList +LuotDiO • - " en Lo'p Ngan Hang -tongODat: lnterger -tongODatDangGiu : Interger -tongDich Vu: Inter ger -tongDich VuDang Giu: Interger -tongBenXe: Interg er -tongBenXeDangGi u: Interger -tongNgoiNha: Inte rger -tongNgoiNhaDang Giu: Interger -tongKhachSan: Int erger -tongKhachSanDan gGiu: Interger +NganHangO +NganHang(tongO Dat: Interger, tongDich Vu: Interger, tongBenXe: Interge r, tongNgoiNha: Interger, tongKhachSan: Inte rger) • GVHD: THANH HIEN _ Ths.VO _ _ _ H._ 69 SVTH: HONG_._ MAl - NGOC _ - , MAl xA Y Dl)'NG 3.2.2.2 • TRO CHdI MONOPOL Y TREN MANG Cae Lo'p Di~u Khi~n Lo'p CoTrieuPhu_ Ctrl CoTrieuPhu Ctrl -dB - Ctrl: DB -Ctrl +Co TrieuPhu _ Ctr 10 +XoaCoTrieuPhu(maCoTrieuPhu: String) +NhungNguoiChoiDaDoXNQuyetDinh( coTrieuPhu: CoTrieuPhu) +ThietLapLaiBienSoNutXNBD( coTrieuPhu: CoTrieuPhll) +ThietLapLaiLuotDi( co TrieuPhu: Co TrieuPhu) +ThemCoTrieuPhu(banCo: BanCo, nganHang: NganHang, soNguoiChoi: Interger, danhSachNguoiChoi: ArrayList) • Lo'p NguoiChoi_ Ctrl N uoiChoi & Ctrl -soOToiDa: Inter er +NguoiChoi_ CtrlO + KTKhaN angPhaSan( ngllo iCho i:N glloi Choi): Boo lean +TungXiNgall(nguoiChoi: NguoiChoi ) +TungXiNgauBanDau(nguoiChoi: NguoiChoi) +TungSoNutXiNgau VoiNguoiKhac(nguoiChoi: NguoiChoi) +TungXNBanDauLanNuaNeuTrung(nguoiChoi: NguoiChoi) +TungXiNgauRaTu(nguoiChoi: NguoiChoi) +TinhTienCamCoNha(NguoiChoi: NguoiChoi) +TinhTienCamCoDat(nguoiChoi: NguoiChoi) +TinhTienCamCoDich Vu(nguoiChoi: NguoiChoi) +TinhTienCamCoBenXe(nguoiChoi: NguoiChoi) +BanDat(nguoiChoi: NguoiChoi) +BanNha(nguoiChoi: NguoiChoi) +BanDich Vu(nguoiChoi: NguoiChoi) +BanBenXe(nguoiChoi : NguoiChoi) +KiemTraCoTaiSan(nguoiChoi: N uoiChoi): Boolean GVHD: Ths.vD THANH HI EN 70 xA Y Dl)'NG TRO CHOI MONOPOLY TREN MANG +TongTienNeuCamCo(nguoiChoi:NguoiChoi): Interger +CoNha(nguoiChoi: NguoiChoi): Boolean +CoDat(nguoiChoi: NguoiChoi): Boolean +CoDichVu(nguoiChoi: NguoiChoi): Boolean +CoBenXe(nguoiChoi: NguoiChoi): Boolean +LayViTriODatCoNha(nguoiChoi: NguoiChoi): String +LayViTriODat(nguoiChoi: NguoiChoi): String +LayViTriBenXe(nguoiChoi: NguoiChoi): String +LayViTriDichVu(nguoiChoi: NguoiChoi): String • Lo'p OBatDau_ Ctrl OBatDau +OBatDau CtrlO +NhanTien(nguoiChoi:NguoiChoi, GVHD: Ths.VO THANH HrEN ••••••••••• _ •• ~ ••• , ••••••••••••••• ••• _ ••• _H ••• _ • ••••••••••••••••••••••••••••••••••••••••••• , ••••• _ • ••• 71 Ctrl oBatDau: OBatDau) SVTH: HONG MAl - NGOC MAl •• - •••••••••• _ •••• P_ ••••••••• XA Y Dl/NG • TRO CHOI MONOPOLY TREN Mt;\NG Lo'p ODat_ Ctrl ODat Ctrl -dB Ctrl: DB Ctrl +OOat_ CtrlO +ConTrong( oDat: ODat) : Boolean +KTKhaNangMuaDat(oDat: ODat, nguoiMua: NguoiChoi): Boolean +MuaDat( oDat: ODat, nguoiMua: NguoiChoi) +KTKhaNangMuaNha(oOat: ODat, nguoiMua: NguoiChoi): Boolean +KTKhaNangXayNha( oDat: ODat): Boolean +KTViTriXayNha( oDat:ODat ):Boolean +TinhTienThue( oDat: ODat): Interger +DongThue( oDat: ODat, nguoiMua: NguoiChoi) +LayThongTinODatO +KTLoDatSoHuu(oOat: OOat, nguoiSoHuu: NguoiChoi): Boolean +ThemLoDatSoHuu(oDat: ODat, loDat: LoDat, nguoiSoHuu: NguoiSoHuu) +LayODatXayNha(nguoiSoHuu: NguoiChoi ): ODat +ChonODatXayNha(loDat: LoDat): ODat +XayNha(oDat: ODat) +LayThongTinODatO: String +TinhTienNeuCamCo(oDat: ODat): Interger +TinhTienNeuCamCoNha( oDat: ODat): Interger +TinhTienNeuCamCoDat(oDat:ODat): Interger GVHD: _ _ Ths.VO _ _ THANH HI EN _ 72 XA Y Dl/NG TRO CHOI MONOPOL Y TREN MANG • Lo'p ODichVu_Ctrl ODichVu Ctrl +ODichVu_CtriO +ConTrong(oDichVu: ODichVu): Boolean +KTKhaNangDongThue(oDichVu: ODichVu, nguoiMua: NguoiChoi, danhSachDich Vu: ODich Vu[]): Boolean +MuaDich Vu( oDich Vu: ODich Vu, nguoiMua: NguoiChoi) +TinhTienThue( oDich Vu: ODich Vu, nguoiMua: NguoiChoi, danhSachDich Vu: ODich Vu[]): Interger +DongThue( oDich Vu: ODich Vu,nguoiMua: NguoiChoi, danhSachDich Vu: ODich Vu[]) +KTKhaNangMuaDichVu(oDichVu: ODichVu, nguoiMua: NguoiChoi): Boolean +TinhTienNeuCamCo( oDich Vu: ODich Vu): Interger OBenXe Ctrl +OBenXe_CtrIO +ConTrong(oBenXe: OBenXe): Boolean +KTKhaNangMuaBenXe(oBenXe: ObenXe, nguoiMua: NguoiChoi): Boolean +MuaBenXe(oBenXe: OBenXe, nguoiMua: NguoiChoi) +KTKhaNangDongThue( oBenXe: OBenXe, danhSachBenXe: OBenXe[], khach: NguoiChoi): Boolean +TinhTienThue(khach: NguoiChoi, danhSachBenXe: OBenXe[] ,oBenXe: OBenXe ):Interger +DongThue(khach: NguoiChoi, danhSachBenXe: OBenXe[], oBenXe: OBenXe) +TinhTienNeuCamCo(oBenXe: OBenXe): Interger GVHD: Ths.VO THANH HIEN 73 SVTH: HONG MAl - NGOC • MAl xi\ Y • DVNG TRO CHOI MONOPOLY TREN MANG Lo'p CoHoi_ Ctrl CoHoi Ctrl -oBenXe Ctrl: OBenXe Ctrl +CoHoi_ CtrlO +LayTheCoHoi(nguoiChoi: NguoiChoi, danhSaehCoHoi: TheRut(D +CoHoiHanhDong(nguoiChoi: NguoiChoi, eoHoi: TheRut, nguoiCungehoi: ArrayList) +DenBenXeMienTay(nguoiChoi: NguoiChoi, oBenXeMienTay: OBenXe) +TraThueBenXeGapDoi(nguoiChoi: NguoiChoi, oBenXe: OBenXe, danhSaehBenXe: OBenXe(]): lnterger +TuSuaTaiSan(nguoiChoi: NguoiChoi) +VaoTu(nguoiChoi: NguoiChoi) +LuiLaiBaBuoe(nguoiChoi: NguoiChoi) +BauToTruong(nguoiChoi: NguoiChoi, nguoiCungChoi: ArrayList) +DuoeGiayRaTu(nguoiChoi: NguoiChoi) +QuaOBatDau(nguoiChoi: NguoiChoi) GVHD: Ths.VfJ THANH HtEN 74 xA Y Ol/NG • TRO CHOI MONOPOLY TREN MANG Lo'p KhiVan_ Ctrl KhiVan Ctrl +KhiVan_CtrlO +LayTheKhiVan(n guoiChoi: NguoiChoi, danhSachKhiVan: TheRut[J) +KhiVanHanhDon g(nguoichoi: NguoiChoi, khiVan: TheRut, danhSach KhiVan: TheRut[]) + LamDuong( nguo ,Choi: NguoiChoi) +DiBacSi(nguoiC hoi: NguoiChoi) +NhanTienKeThu c(nguoiChoi: NguoiChoi) +ToChucNhacHoi (nguoiChoi: Nguoichoi, nguoiCungChoi: ArrayList) +NhanQuaGiangSi nh(nguoiChoi: NguoiChoi) +NganHangTraTie n(nguoiChoi:N uoiChoi) • Lo'p ThueDacBiet_ Ct rl ThueDacBiet -oThueDacBiet: Ctrl ThueDacBiet +ThueDacBiet Ct rlO +KTKhaNangDon gThue(nguoiChoi: Boolean +DongThue(nguoi Choi: NguoiChoi) GVHD: Ths.vD THANH _ HIEN •• _ ••••• , •• _ •••••••••• H ••••••••••••• 75 NguoiChoi): xA Y Dl/NG • TRO CHOI MONOPOLY TREN M~NG Lo'p T hue Th u Nhap_ etrl ThueThuNha etrl -oThueThu Nhap: OThueThuNhap +ThueThu Nhap_CtrlO NguoiChoi, +KTKhaNa ngDongThue(nguoiChoi: chiSoChon: Interger): Boolean +TinhTienT hue(nguoiChoi: NguoiChoi, chiSoChon: Interger): In terger +DongThue (nguoiChoi: NguoiChoi, chiSoChon: Interger) • Lo'p OVaoTu_ etrl OVaoTu etrl -oVaoTu: VaoTu +OVaoTu - CtrlO +GhiNhanV aoTu(nguoiChoi: NguoiChoi) +NopPhiRa Tu(nguoiChoi: NguoiChoi) +GhiNhanR aTu(nguoiChoi: NguoiChoi) " GVHD: Ths.vi) THANH H lEN _ ••••••••••••••••••••••••• R ••••••••••• 76 SVTH: HONG MAI- NGQC MAl xA Y DVNG 3.2.2.3 TRO CHor MONOPOLY TREN MANG Cae LOll I>i~u Khi~n Co' So' Du' Li~u • Lo'p KetNoiCSDL KetNoiCSDL -sqlConnection: SqlConnection -sqlCommand: SqlCommand -sq IDataAdapter: Sq IDataAdapter -commandText: String -commandType: CommandType -valueCollection: String[] -parameterCollection: Strin [] +KetNoiCSDLO +MoKetNoiO +DongKetNoiO +ThemThamSo(sqlCommand: SqlCommand) +ExecuteNonQueryO: Interger +ExecuteScalarO: Object +Tra VeDataSetO: Dataset +TraVeDataTableO: DataTable GVHD: Ths.VO_H_ THANH HI EN _ _ ~ h._ ~._ _ 77 XA Y Dl/NG TRO CHOI MONOPOLY TREN Mf\NG • DB Ctrl • -ketNoiCSDL: KetNoiCSDL -commandText: String -commandType: CommandType -parameterCollection: String[] -valueCollection: String[] +KhoiTaoO +Tra VeData Tab leeten -proced ure: String, thamso: Strin g[], giatri: string[]): DataTable +TraVeDataTable(ten-procedure: String): DataTabie +TraVeDataTable_sqI_query(chuoiTruyVan: String): DataTable +TraVeDataSet(ten-procedure: String,thamso: String[J, giatri: string[]): DataSet +TraVeDataSet(ten-procedure: String): DataSet +DataSet_sqI_query(chuoiTruyVan: String): DataSet +ThucHien_insert_update_delete(ten-procedure: String, thamso: String[], giatri: String[]): Interger +ThucHienScalar_count_sum_avg(ten-procedure: String, thamso: String[], giatri: String[]): Object +ThucHienScalar _count_sum_avg(ten_procedure: String): Object +ThucHienScalar _count_sum _ avg_sq 1_query( chuoiTruyVan: String): Object GVHD: Ths.vD THANH HIEN 78 xAY DVNG TRO CHOI MONOPOLY TREN MANG & , • ChU'O'ng KET LuAN vA HuONG PHAT TRIEN 4.l.K~t qua d~t dm;)'c Tro chai augc xay d\fl1g ail aap ung augc cac chuc nang ban a~u cua tro chai: • Tro chai chC;lytren moi truang mC;lngC\lCbQ va Internet, cho phep tu hai a~n b6n nguai cung chai • Nguai chai aang nh~p VaG h~ th6ng co th~ chat, tC;lotro chai va tham gia tro chai ail tC;lO s~n • Tro chai co phan lUg! Theo lug! cua minh, nguai chai augc tung Xl ng~u, mua nha • • The bai cua nguai chai augc di chuy~n a~n nut hai Xl ng~u Tuy vao a nguai a ca tuang tmg vai t6ng s6 chai dung IC;li,h~ th6ng se co cac phan ung phu hgp • • Nguai Chai augc quy~n thay o6i ban ca khac nhau, thay o6i lu~t a~t oai, quy ajnh IC;ligia ti~n 4.2.HU'ong phat tri~n D\fa tren cac k~t qua oC;ltaugc, tro chai se co huang phM tri~n nhu sau: • Co nhi~u muc oQ chai tu d~ o~n kho • Tro chai cho phep tuang tac gifra nhung nguai chai Vi d\l, nguai chai co th~ trao a6i t~ti san vai chai GVHD: Ths.vD THANH HIEN 79 SVT H: HONG MAl - NGQC MAl xA Y DV'NG TRO CHOI MONOPOLY TREN MANG • Them tinh nang c~m c6 d