




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of procedural and event-driven programming, their characteristics, and the relationship between them. Procedural programming is a top-down approach, while event-driven programming is service-oriented and time-driven. The document also includes information about input and output in the context of the given program.
Typology: Essays (university)
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyễn Lâm Thắng Student ID GCH Class GCH0716 Assessor name Trương Công Đoàn 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 Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D
Grade: Assessor Signature: Date: Lecturer Signature:
Figure 21: Debug ( Step into ) ................................................................................................................. 21 Figure 22 : Debug ( Step out ) ................................................................................................................. 22 Figure 23 : Variable popup ...................................................................................................................... 23 Figure 24 : Debug conditionally .............................................................................................................. 24 Figure 25: comment ................................................................................................................................ 26 Figure 26 : apply comment ...................................................................................................................... 27 Figure 27 : apply to name variable........................................................................................................... 27
This report, I will show you some information about Procedural, object-oriented and event-driven paradigms. Moreover I also explain clearly about Debbuging, Coding Standard, include examples and how I use them in my program. These documents help you develop effective programs from Application Visual Studio 2019. After that, I will solve business problem by writing a program by using IDE. Finally, In my assignment I will make it with Visual Studio 2019
1.Procedural The procedural programming paradigm is represented as a series of steps in which a computer programmer writes a code to perform a specific task. The first line of code is executed first, then the second line of code, then the third, up to last line of code. Therefore, procedural programming is a top-down approach to executing lines of codes. The most popular languages that use procedural paradigm are BASIC, COBOL, PASCAL and FORTRAN. In these languages, a program comprises of steps or procedures that operate on data. Procedural programming has many characteristics like local variables, global variables, pre-defined functions, modularity, and parameter passing in function and procedures. (https://study.com, 2019) 2.Object-oriented The object-oriented paradigm is based on objects and classes and their re-use to perform a specific code- function. So, unlike the procedural paradigm, the object-oriented paradigm uses bottom-up approach. In the simplest form, these objects contain data in the form of fields. Programs are divided into smaller units known as objects belonging to a class. These objects interact with each other through functions. Most popular languages that use object-oriented paradigm are C++, Java, Objective-C, Python. The characteristics of languages using the object-oriented paradigms are the use of objects, classes, encapsulation, inheritance, data abstraction, dynamic binding, message passing and polymorphism. (https://study.com, 2019)
Object oriented is looking at the actors and creating objects to represent those actors. For example, an emulator for a movie line queue. You’ve got people, the line, and a ticket booth. So, you build objects around those actors. Event driven, is used when you have spontaneous moments that need to be taken care of. You can add event handlers to both procedural and object oriented paradigms. So, as a stand alone, it’s not a complete paradigm. For instance your procedural report writer could have an event to handle out of paper. Or the object oriented program could have an event to handle when lightning hits a person standing line for the movie. (https://www.quora.com, 2019)
1. Business problem Suppose that I'm an employee at an electrical station at Thanh Xuan county in Ha Noi. Whenever becoming the end of the month, I have to collect the number of electricity of every customer at Thanh Xuan county. Then I have to calculate the money which has to pay based on the electric price public. This takes me very much time because of calculating them. Final, I need to have a list that includes information, number of electricity and the money has to pay. Then I send that list for an other employee so as to that employee needs to do other necessary work. Because calculating the money has to pay takes me very much time, I decide to design a program that can help me do that easily. That program has some functions, such as entering information ( include name, address, the number of electricity ), showing list that was entered , edit information and delete the customer which user wants. 2. Input / Output 2.1 Input To enter information of customers, I need to input data, include name of customer ( has type string ), address of customer ( has type string ) and the number of electricity ( has type int ). After processing by program, the money ( has type int ) which has to pay, is calculated and this money will be showed. 2.2 Output After entering everything, output is the list that was entered ( include name, address, the number of electricity and the money has to pay ).
5. Flowchart Figure 1 : How to calculate the money
6. Implementation To implement, I design the program has 6 buttons and 4 textboxs. 6 buttons are Add , Edit , Delete , Calculate , Save and Cancel. 4 textboxs are “ name of customer “, “ Address “, “number of electricity” and “ money “. At textbox money , user can’t enter anythings because this textbox will show the money after clicking button Calculate. To input data into program, first, have to click Add, then input data into every textbox, include Name of customer, Address, Number of electricity. After that user need to click button Calculate. Finally, to finish entering, user just click button Save. Now, every information is in the list. If user want to add more, user just click button Add again. To edit information, user just click at the customer which user want to edit. Then click button Edit, now user enter new information. After entering, to finish editing, user just click button Save. After that, information of that customer is editted automatically. If user want to delete a customer. First, user click at the customer which user want to delete. Then click button Delete. After that, a warning message will be showed, user click Yes to be sure that want to delete this customer. After clicking Yes , the list customer will be update ( doesn’t have the customer which was deleted ). After adding information, If user enters wrong data, user can click button Cancel to re-enter data. Figure 2 : Implementation
Figure 5 : Edit button Figure 6 : Save button
Figure 7 : Cancel button Figure 8 : Delete button
8. Result There are some screenshots when running program: Figure 9 : Start program
Figure 12 : Add information of second customer ( NOTE : At all textboxs, user doesn’t enter anythings and then click Save button ) Figure 13 : Add information of second customer successfully
Figure 14 : Edit second customer Figure 15 : Edit successfully
1. Theory of debugging Definiton : Debugging is the routine process of locating and removing computer program bugs, errors or abnormalities, which is methodically handled by software programmers via debugging tools. Debugging checks, detects and corrects errors or bugs to allow proper program operation according to set specifications. (www.techopedia.com, 2019) 2. Show evidence how to use debugging in your code 2.1 Break point After I set a break point, I start running the debugger program by press f5 /Debug =>start debugging. Figure 18 : Debug ( break point ) After running program ( Enter data and click Calculate button ), the program stop, so breaking point is working so well. The program will be excuted until the breakpoint is met and before data money is calculated.
Figure 19 : Debug ( break point next ) 2.2 Step over