



















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!




















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 TRAN LE DUY Student ID BH Class IT601 Assessor name 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 DUY Grading grid
A programming model that divides a program into functions or subroutines. Each program can also be divided into many other subroutines to simplify their work. Structure-oriented structure setting characteristics Focus on the work to be done (algorithm) A large program is divided into subroutines, each of which can be called one or more times in any order. Most functions use common data Secondary data in the system are moved from one function to another. Function that transforms data from one form to another Using a top-down approach in program design Simple, easy implementation of compilers and interpreters The ability to re-use the same code at different places in the program without copying it. An easier way to keep track of program flow. The ability to be strongly modular or structured. Needs only less memory. Programs are more easily and more quickly written Programs are reliable as fewer organizational and logical errors occur during the initial stages of program development.
is a computer programming model that designs software around data, or objects, instead of functions and logic. Characteristic: • Abstraction: Representing complexity in a set of values by a simple model that focuses on important characteristics of the object in each situation. • Inheritance: Build a new class based on an existing one: Base class > Derived class • Encapsulation: A set of abstract components encapsulated into a class with the concept of information hiding. • Polymorphism: The mutation of derived classes In an event-driven application, there is generally a main loop that listens for events and then triggers a callback function when one of those events is detected. In embedded systems, the same may be achieved using hardware interrupts instead of a constantly running main loop. Event-driven programs can be written in any programming language, although the task is easier in languages that provide high-level abstractions, such as await and closures.
Procedural programming is only used to teach programming for beginners or algorithms for thinking, breaking problems into small problems. It doesn't work in large systems. Object-driven programming, it applies to large systems and problems. However, it has not been used for practical applications. To create a real application, object-oriented and event-driven programming models must be used to build a real application system. In structured programming, the problem is taken, and analyzed from top to bottom, when you find a logical situation too complex, you try to divide it into parts (like pizza slices). The idea is to divide the logical complexity into functions or procedures that are easy to understand and solve. The classic, divide and win. If properly worked, functions or procedures will appear that are reused in different parts of the code. With OOP, on the other hand, the approach is to discover the elements involved in the problem (people, documents, products, etc.) by analyzing the data (properties) that each one manages, together with the methods (which are nothing other than functions or methods). Then, you create derived classes (sub-classes) of the main classes (for example of people: employees, suppliers, customers, etc.) that reuse the methods and properties of the main class (inherit) and add the specific ones. In event-oriented programming, procedures, objects, methods etc. They "fire" when an "event" occurs (mouse click, keyboard click, window activation, etc.) and is common when you have to program a GUI. Generally, the code is distributed in a structured way in the application (modules, libraries) where classes and subclasses are defined. If the application has to work with events, in some part of the code the events will be associated with the procedures, functions or methods that manage them. Personally, I use a combination of these three paradigms. But in any case, it depends on what type of program is being solved.
**Once set up to perform the operation on the button so that the program can operate: With the Add button I have set Employee = NEW EMPLOYEE based on EMPLOYEE from which it will inherit the properties of EMPLOYEE EMPLOYEE[] listEMPLOYEE = new EMPLOYEE[100]; int n = 0; private void ADDbt_Click_1(object sender, EventArgs e) { EMPLOYEE employeezzz = new EMPLOYEE(); employeezzz.NAME = txtNAME.Text; employeezzz.JOBS = txtJOBS.Text; employeezzz.ADDRESS = txtADDRESS.Text; employeezzz.AGE = txtAGE.Text; employeezzz.EXPERIENCE = txtEXPERIENCE.Text; listEMPLOYEE[n] = employeezzz; n++; display(); } public void display() { dgvEMPLOYEE.DataSource = null; dgvEMPLOYEE.DataSource = listEMPLOYEE; dgvEMPLOYEE.Refresh(); } int ind; // Of course we need to configure the display at this button private void dgvEMPLOYEE_CellClick_1(object sender, DataGridViewCellEventArgs e) { ind = e.RowIndex; txtJOBS.Text = listEMPLOYEE[ind].JOBS.ToString(); txtNAME.Text = listEMPLOYEE[ind].NAME.ToString(); txtADDRESS.Text = listEMPLOYEE[ind].ADDRESS.ToString(); txtAGE.Text = listEMPLOYEE[ind].AGE.ToString();
******And of course, the button exit : this button just needs a simple command line that commands the computer in C language.# :** private void EXITbt_Click(object sender, EventArgs e) { Application.Exit(); ** In addition I created a new window form for the application's login screen
I installed the security app by creating a user and password via the login button with the IF and else command : private void btLOGIN_Click(object sender, EventArgs e) { if(txtuser.Text == "leduy" && txtpassword.Text == "123456") { new Form1().Show(); this.Hide(); } else { MessageBox.Show(" Wrong"); txtuser.Clear(); txtpassword.Clear(); } } } }