Báo cáo đồ án thực hành lập trình hướng đối tượng microsoft visual studio lập trình theo hướng đối tượng

11 3 0
Báo cáo đồ án thực hành lập trình hướng đối tượng  microsoft visual studio  lập trình theo hướng đối tượng

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TRƯỜNG ĐẠI HỌC KHOA HỌC TỰ NHIÊN ĐẠI HỌC QUỐC GIA THÀNH PHỐ HỒ CHÍ MINH BÁO CÁO ĐỒ ÁN THỰC HÀNH LẬP TRÌNH HƯỚNG ĐỐI TƯỢNG Lê Mỹ Khánh Quỳnh - 21127681 MỤC LỤC I GIỚI THIỆU ĐỒ ÁN: NỘI DUNG ĐỒ ÁN: .2 CÔNG CỤ: NGÔN NGỮ LẬP TRÌNH: KỸ THUẬT: II MÔ TẢ HỆ THỐNG MÃ NGUỒN: III UML CLASS: IV LỜI KẾT: .12 Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong I GIỚI THIỆU ĐỒ ÁN: NỘI DUNG ĐỒ ÁN: - Trong phần đồ án ta phối hợp kĩ thuật, cấu trúc liệu kiến thức lập trình hướng đối tượng để xây dựng hệ thống moodle Để thực đồ án ta cần kiến thức như: xử lý tập tin, tiểu trình, handle, cấu trúc liệu kiến thức lập trình hướng đối tượng… CÔNG CỤ: - Microsoft Visual Studio NGÔN NGỮ LẬP TRÌNH: - Ngơn ngữ: C++ KỸ THUẬT: - Lập trình theo hướng đối tượng Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong II YÊU CẦU ĐẠT ĐƯỢC: Thêm khóa học vào hệ thống, thêm người dùng vào hệ thống,thêm sinh viên/ giảng viên vào khóa học o Khi khởi động người dùng nhập vào type user cần đăng nhập vào:  Ở đây, class NguoiDung (base class class GiaoVu, SinhVien GiangVien) xây dựng theo cấu trúc prototype design pattern Giúp người dùng linh hoạt thao tác mở rộng mã nguồn o Sau người dùng nhập vào type user tương ứng, hệ thống tiến đến bước đăng nhập Tùy thuộc vào user type mà người dùng nhập vào, chương trình hỗ trợ thao tác chức tương ứng o Để thực thao tác thêm khóa học / người dùng, ta phải đăng nhập type GiaoVu Khi hệ thống diễn hoạt chương trình chức GiaoVu o Chức thêm người dùng/ khóa học: thiết kế mã nguồn tương đồng Người dùng phải nhập vào liệu người dùng khóa học cần add Hệ thống kiểm tra xem danh sách Người dùng Khóa học hệ thống tồn đối tượng cần thêm chưa Nếu tồn tại, chương trình trả dịng warning : “người dùng / khóa học tồn tại” kết hàm ADD trả false Ngược lại, hệ thống chưa tồn thực thêm người dùng / khóa học vào danh sách tương ứng hệ thống trả giá trị true Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong o Thêm sinh viên / giảng viên vào khóa học: Ở chức người dùng phải nhập liệu cho user khóa học Chương trình tìm xem khóa học tồn hệ thống hay chưa ? Nếu chưa thực thêm khóa học vào hệ thống thêm người dùng vào khóa học o Giảng viên tạo hoạt động sinh viên tham gia hoạt động o Để thực tạ Sinh viên nộp tập Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Giáo viên chấm điểm tập Nhập thông tin tài nguyên hoạt động (thông qua file txt với cấu trúc tự xây dựng) Mô sinh viên nộp Mô giáo viên chấm o Khi chạy chương trình, hình consol xuất MENU CHÍNH hệ thống   o Thêm khóa học vào hệ thống: Input liệu cho khóa học push vào danh sách khóa học hệ thống Trong trường hợp khóa học tồn (xét dựa vào tên khóa học) hệ thống warning: “khoa hoc da ton tai.” Và không thực việc thêm khóa học vào hệ thống Tương tự với chức thêm người dùng Thêm user vào khóa học: Hệ thống yêu cầu người dùng nhập liệu khóa học người dùng cần thêm vào khóa học Nếu khóa học chưa tồn hệ thống, chương trình thực thêm khóa học vào hệ thống thực thêm người dùng vào khóa học III PSEUDOCODE: Function NewGame() if not loaded create defaullt Map ; draw Map; InitNewState(); draw Player; while game is over if not pause RandomNextState(); else draw Menu Pausing; switch pos : case : SaveGameMenu(); case : LoadGameMenu(); case : out; switch key : case p : clean Menu Pausing; case w : go up; case d : go down; case a : go left; case s : go right; if not end and win if print level up -> choose true Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong next level; draw map; InitNewState(); draw player; Function InitNewState() create Player; create Rows; randomi Rows -> init random Enemy with different features; speed up Rows[random]; sleep; MoveToNextState() Function MoveToNextState() random int -> draw Traffic Light; random Rows -> push Enemy; Function RandomNextState() random Rows -> add new Enemy; MoveToNextState(); draw Map; Function ContinueGame() Print Map; Print “Game Over”; //cout UTF8 switch(key) case a: { pos ; if(!isMute1 && !isMuteAll) PlaySound(); } case s: { pos++; if(!isMute1 && !isMuteAll) PlaySound(); } case 13: return !pos; Function GameSetting() Print Menu; switch(key) Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong case w: pos ; case s: pos++; case 13: switch(pos) case 0: Mode Setting; case 1: Sound1 Setting; case 2: Sound2 Setting; case 3: Out; Function GameMenu() Print Menu; switch(key) case d: pos++; case a: pos ; case 13: switch(pos) case 1: New Game; case 2: Load Game; case 3: Setting; case 4: Exit; Function SaveGame() Open file Writefile -> level x,y vector rows(rowsData.ListRow()) i=0 while(i < 6) writefile rows[i]->CurrentRow, Direction, Speed, Redlight vector enemy(rows[i]-> Enemy) writefile enemy size j=0 while(j < enemy size) writefile enemy[j]->X,Y,type Close file Function LoadGame(string s) open file if file is not open return false readfile lv,playerX,playerY ~Level() new(&level) nLevel(lv, 0) ~player() Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong new(&player) pPlayer(pPosition(playerX, playerY)) nEnemy = ~qRows() new(&rowsData) qRows() i=0 While ( i < ) readfile CurrentRow,Direction,Speed,Redlight Push row on road data readfile enemysize Enemy += enemysize j=0 while( j < enemysize ) readfile eX,eY,eType Push enemy on road data Close file return true Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong Bao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuongBao.cao.do.an.thuc.hanh.lap.trinh.huong.doi.tuong microsoft.visual.studio lap.trinh.theo.huong.doi.tuong

Ngày đăng: 30/12/2023, 05:13

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan