Docsity

Algorithms, Programming Models, and Debugging Processes, Summaries of Plasma Physics

Partial preview of the text

Download Algorithms, Programming Models, and Debugging Processes and more Summaries Plasma Physics in PDF only on Docsity!

BTEC FPT INTERNATIONAL COLLEGE

INFORMATION TECHNOLOGY
ASSIGNMENT 1
UNIT: PROGRAMMING
STUDENT : PHAN QUANG HOP
CLASS : IT
STUDENT ID : BD
SUPERVISOR : NGUYEN HOANG ANH VU
DANANG,JULY 2022
ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 4 HND Diploma

in computing

Unit number and title Unit: Programming Submission date Date received (1st submission) Re-submission date Date received (2nd submission) Student name

PHAN QUANG HOP

Student ID

BD

Class

IT

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

ASSURANCE

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

LIST OF TABLES AND FIGURES

  • CRITICAL EVALUATION.......................................................................................................
  • CONCLUSION......................................................................................................................
  • REFERENCES...........................................................................................................................
  • Figure 1 algorithm....................................................................................................................
  • Figure 2: put the rice in the pot...............................................................................................
  • Figure 3 put water in rice wash rice.........................................................................................
  • Figure 4 put the song in the pot...............................................................................................
  • Figure 5 plug in power..............................................................................................................
  • Figure 6 algorithm....................................................................................................................
  • Figure 7 flow chart....................................................................................................................
  • Figure 8 flow chart lamp...........................................................................................................
  • Figure 9 flow chart Cook rice....................................................................................................
  • Figure 10 average score algorithm...........................................................................................
  • Figure 11 analysis...................................................................................................................
  • Figure 12 find a solution.........................................................................................................
  • Figure 13 design.....................................................................................................................
  • Figure 14 code........................................................................................................................
  • Figure 15 bug..........................................................................................................................
  • Figure 16 Testing....................................................................................................................
  • Figure 17 Source code............................................................................................................
  • Figure 18 bug..........................................................................................................................
  • Figure 19 run the program.....................................................................................................
  • Figure 20 communication language c#..................................................................................
  • Figure 21 flow chart student score chart...............................................................................
  • Figure 22 code.......................................................................................................................
  • Figure 23 Fix bug....................................................................................................................
  • Figure 24 run function program 1..........................................................................................
  • Figure 25 run function program 3..........................................................................................
  • Figure 26 run function program 4..........................................................................................

CHAPTER 1: Explain the characteristics of procedural,

object-oriented and event-driven programming,

conduct an analysis of a suitable Integrated

Development Environment (IDE)

1 The definition of programming models

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

1.1 Characteristics of the programming models

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

CHAPTER 2 Implement basic algorithms in code

using an IDE(LO3)

2.1 Write a program that implements an algorithm using an

IDE

  • viết chương trình đầu vào là đăng nhập vào hệ thống quản lí của nhân viên. đầu ra nhân viên được đăng nhập vào hệ thống của quản lí để tính công. Đầu tiên tôi sẽ thiết kế form đăng nhập Thiết kế nơi nhập tên đăng nhập và mật khẩu Thứ 2 thiết kế chỗ làm mới để nhập tên khác Thứ 3 là nút thoát Và tôi đã viết code cho phần login với các tài khoản của nhân viên đã được tôi cấp trước đó Tôi viết code cho nút xoá khi bấm vào nút xoá nó sẽ làm mới và làm trống các ô tên đăng nhập và mật khẩu Tôi viết code cho nút thoát dùng lệch close để kết thúc chương trình Dưới đây là thiết kế của phần mền quản lí nhân viên 7

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