

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















Unit number and title Unit: Programming Submission date Date received (1st submission) Re-submission date Date received (2nd submission) Student name
Student ID
Class
Assessor name Nguyen Hoang Anh Vu Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature: PHAN QUANG HOP i
Internal Verifier’s Comments: Signature & Date: ACKNOWLEDGMENTS First of all, I would like to thank my teacher Nguyen Hoang Anh Vu for always supporting me in my studies and research, for my patience, motivation, enthusiasm and rich knowledge. His enthusiastic guidance has helped me throughout the time of researching and writing this thesis. Without your wonderful help, I would not have been able to achieve this. Besides the teacher, I would like to thank the friends who helped me improve my subject knowledge. Not only that, they are always there to support me when I need it. And besides, I would like to thank the school for creating all conditions for me to have all the facilities to help me complete my work well. Finally, I would like to thank my family: my parents, who gave birth to me from the beginning and always supported me mentally. They are always behind to care and give me more motivation to do well. iii
Declaration of the learner I verify that the work I've submitted for this assignment is all my own, and that all research sources have been properly credited. Signature of the student: student: Date: HOP
I declare that this is my work, based on my research, and that I have recognized all materials and sources utilized in its production, including books, papers, reports, lecture notes, and any other type of document, electronic or personal communication. I further declare that I have not previously submitted this assignment for assessment in any other unit, except where explicit permission has been granted by all unit coordinators involved, or at any other time in this unit, and that I have not duplicated or stolen ideas from the work of others in any way. iv
Procedural programming and give examples Procedural programming: interested in the function of the procedure to be performed. The class program is broken down into sections and read together. mostly used general data. program = structure + algorithm. Programs are broken down into subroutines to be placed together to be built into an application. separate running subroutines and separate data. exchanged via parameters and global variables. in designing a program, follow a top-down programming approach. Most functions allow system-wide data to be shared. it the programs are broken down and are called functions. it allows data to flow freely around the system. data converts functions from one form to another. Ví dụ 1
Figure 1 procedural programming Lập trình hướng sự kiện Event-driven programming is a programming paradigm where all business processing is done in the program's source code. The program's runtime thread will be determined on events. events here can be : press key on the keyboard. mouse hover. The feature of event- oriented programming is that it is built on object-oriented programming. however it is upgraded and updated because of event capture issues like mouse click. it is often used when programming GUI (graphical interface) like for example : nhấp chuột gõ chữ trên bàn phím 2
from the object, no matter which object is the base class type or the derived class, then it will call the corresponding method. for example 4
Figure 3
set up procedures advantage : breaking a large program into subroutines makes programming easier to recognize and manage programs better defect : does not strongly support code reuse Not suitable for large quilts multiple access functions. use common data. The data in the system moves from one function to another, so it is difficult to control the data focus on the work to be done (algorithm) Large programs are broken down into small functions, but if the information is not consistent, there are big consequences. object-oriented programming Advantages : encapsulation change management data protection remove duplicate code Shorten system build time Manage the complexity of large software projects and programs easy to expand and upgrade Increased productivity and efficiency The program is designed according to the correct process (because it is built from the exchange of units (objects) and not based on experience and techniques as before. defect: 5
Figure 4 Dưới đây là code của phần mền quản lí nhân viên 8
Quá trình gỡ lỗi Bước 1 tìm lỗi Bước 2 tìm nguyên nhân gây ra lỗi , lỗi cú pháp , lỗi khai báo , lỗi thuật toán … Bước 3 xử lý lỗi Bước 4 chạy thử nghiệm và kiểm tra Ví dụ 10
Figure 6 code Figure 7 Bug Dòng 35 lỗi cú pháp dòng 46 biến không xác định Dòng 61 lỗi cú pháp Dòng 70 lỗi định dạng 11