


















































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!



















































i
Unit number and title Unit: Programming Submission date 14/8/2022 (^) Date received (1stsubmission)
Re-submission date Date received (2ndsubmission) 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 theconsequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature: NGUYEN TRINH ANH TUAN
i
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.
i 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: Date: TUAN
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.
i M4 Evaluate how the debugging process can be used to help develop more secure, robust applications............................................................................................................. 33 Integrates many programs such as code completion, compiler, editor Outline the coding standard you have used in your code. (P5) ........................................................ 38 CRITICAL EVALUATION ........................................................................................ 45 CONCLUSION ........................................................................................................ 46 REFERENCES ....................................................................................................... 47
i
Programming plays an extremely important role in life. Coming to this report, we will learn about understanding programming models such as procedural programming, object- oriented programming, and event-oriented programming. As well as the structure of a program, data, and basic data, while also introducing students to the use of an integrated development environment (IDE), its functions, and some standard rules, such as naming in code. At the same time, it assists students in learning how to create simple apps. Let's find out in this assignment! This report includes the following: CHAPTER2: PROBLEMS RELATED TO PROGRAMMING METHODS AND INTEGRATED DEVELOPMENT ENVIRONMENT (IDE)
i Key features of Procedural Programming
i Figure 4 Source code : Program to solve quadratic equations Output results Figure 5 Output results Event-driven programming and give examples Event-driven programming is a computer programming model in which the control flow of a program is determined by the occurrence of events. These events are monitored by code called event handlers. If it detects that a specified event has occurred, it runs an event handler (a function or callback method that is fired when the event occurs).
i oriented programming. Most of the programmers have learned about object-oriented programming in university, but the basic principles of object-oriented programming are sometimes not understood, leading to misuse and incorrect philosophy of programming. object oriented. Figure 8 Object-oriented programming An example of Object-oriented programming Figure 9 example of Object-oriented programming
i 2.1.2 Characteristics of the programming models The Programming Paradigm is a way of classifying programming languages based on their characteristics. Programming languages can be classified into many programming paradigms. Some common programming models: Imperative programming is a programming paradigm that uses statements to change the state of a program. Procedure-oriented programming executes groups of statements in procedures/functions Object-oriented programming implements code that creates objects to abstract objects, Declarative programming in which the programmer declares the properties of the desired result, but does not compute it. Functional programming: the desired result is declared as the value sequence of the application function. Logical programming: based on mathematical logic in relationships and inferences Computational programming where the desired result is the solution of optimization problems For example : comparing imperative and declarative programming with C# language, for a set, find numbers that are not divisible by 2: With Imperative Programming, use statements to traverse a list of elements State the characteristics and advantages, disadvantages of the 3 models ➢ Event-driven programming Event-driven programming is a computer programming model in which the control flow of a program is determined by the occurrence of events. These events are monitored by code called event handlers. If it detects that a specified event has occurred, it runs an event handler (a function or callback method that is fired when the event occurs). In theory, all programming languages support the event-driven programming style, although some features of the language, such as closures, make it easier to implement. Other programming environments, such as Adobe Flash, are specifically designed to trigger program code on events. Characteristic
i
i
- Message passing – Objects communicates through invoking methods and sending data to them. This feature of sending and receiving information among objects through function parameters is known as Message Passing. The relationship: Procedural, event-driven and object-oriented paradigms are used to classify programming languages. 2.1.3 Relationship between Procedural, Object-oriented, Event-driven. For relationship between 3 paradigms: The different between 3 paradigms the same with the different between functions, methods and procedures. Procedural programming uses variables to store the state of the application and procedures to change that state. The problem here is that any piece of code can access any variable. That makes it hard to debug this code because a faulty state could have originated anywhere. It also makes it hard to test it because the behavior of a procedure may be different depending on the state of the variables. There are two ways to address that problem: either you restrict access to the variables or youdon't allow modifying them. Restricting access is what OOP does. An object is a group of variables with “procedures” assigned to them. Since they don't access just any variable but only those in the class they are in theyare called methods to tell them apart from procedures. Disallowing modification is what functional programming does. The term function comes from mathematics. If in math you say y=2*x you didn't change x in any way. Instead you calculated a new value. So in programming a (pure) function doesn't change any variables, but it only calculates anew value based on the given parameters. As a rule of thumb procedural programming is the easiest to understand for beginners, but it's also the most bug-prone. Functional programming is the safest but also the least intuitive. OOP isso successful because it's easier than functional programming and safer than procedural. In additionto that it makes communication easier. It takes a programmer to decide which procedures or functions should operate on which variables need to use.