Download Assignment 2 l Programming 1618 and more Assignments Programming Languages in PDF only on Docsity!
Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 31/8/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Tran Doan Dung Student ID GCH Class GCH0908 Assessor name Lai Manh Dung 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 Dzung Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date: Lecturer Signature:
Figure 4- For loop Example ......................................................................... Error! Bookmark not defined. Figure 27- Autos window ............................................................................. Error! Bookmark not defined.
Table of Diagram Diagram 1- Function CheckInfo ................................................................... Error! Bookmark not defined. Diagram 2- Button Add ................................................................................ Error! Bookmark not defined. Diagram 3- Cell Click Event ........................................................................ Error! Bookmark not defined. Diagram 4- Button Edit ................................................................................ Error! Bookmark not defined. Diagram 5- Button Remove.......................................................................... Error! Bookmark not defined. Diagram 6- Button Sort ................................................................................ Error! Bookmark not defined.
- Introduction
- Chapter 1: Introduction to your program....................................................................................................
- 2.1 Overview of the problem
- 2.2 List out application’s requirements
- 3.Chapter 2: Explain programming paradigms
- 3.1 Procedural Programming
- 3.2 Object-oriented programming
- 3.3 Event-driven programming
- programming. 3.4 The relationship between procedural programming, object-oriented programming and event-driven
- Chapter 3: IDE features
- 4.1 IDE definition
- 4.2 Features of IDE with illustrations.......................................................................................................
- 4.3 Debug
- 4.3.1 Definition
- 4.3.2 Debugging process in the IDE used and how it helped with development.
- 4.3.3 how the debugging process can be used to help develop more secure, robust applications
- using an IDE. 4.4 An evaluation of developing applications using an IDE versus developing an application without
- Chapter 4: Design and Implementation
- 5.1 Flowchart, source code and screenshots of the final application
- 5.1.1 Function CheckInfo
- 5.1.2 Button Add
- 5.1.3 Cell Click Event
- 5.1.4 Button Edit...................................................................................................................................
- 5.1.5 Button Remove
- 5.1.6 Button Sort...................................................................................................................................
- 5.1.7 Button Exit...................................................................................................................................
- 5.2 Some coding standards used in the program
- Inconclusion
- References
- Figure 1- Use Case Table of Figure
- Figure 2- Software interface
- Figure 3- How Procedural programming runs the program
- Figure 6- Function in C# Figure 5- Compare Loops Error! Bookmark not defined.
- Figure 7- Using Procedural Programming in the Program
- Figure 8- Show charges for packages
- Figure 9- How Object-oriented programming runs the program
- Figure 10- Object-Oriented Programming
- Figure 11- Display the values of Object in the Product class.......................................................................
- Figure 12- Event-driven programming
- Figure 13- Event-Driven Programming in Programming
- Figure 14- integrated development environment
- Figure 15- Visual Studio 2019 interface
- Figure 16- Text editor in Visual Studio 2019...............................................................................................
- Figure 17- Debug Mode in Visual Studio
- Figure 18- Compiler in Visual Studio
- Figure 19- Code completion in Visual Studio
- Figure 20- Support programing language in Visual Studio 2019.................................................................
- Figure 21- Integrations and additions in Visual Studio
- Figure 22- Start Debugging
- Figure 23- Input Parcel’s Information
- Figure 24- Program in the debugging mode
- Figure 25- Run to cursor...............................................................................................................................
- Figure 2 6 - Edit the code while the program is running
- Figure 29- Call Stack Window Figure 28- Locals Window Error! Bookmark not defined.
- Figure 30- Use IDE to write code.................................................................................................................
- Figure 31- Using Word to code
- Figure 32- Source code CheckInfo
- Figure 33- Result of function CheckInfo......................................................................................................
- Figure 34- Source Code Add Product
- Figure 35- Class Product
- Figure 36- Using Button Add
- Figure 37- Source Code Cell Click
- Figure 38- Package charge function
- Figure 39- Cell Click Event
- Figure 40 - Source Code Button Edit
- Figure 41- Before Use Button Edit...............................................................................................................
- Figure 42- After Use Button Click
- Figure 43- Source Code Button Remove......................................................................................................
- Figure 44- Before Use Button Remove
- Figure 45- After Use Button Remove
- Figure 46- Source Code Button Sort
- Figure 47- Before Use Button Sort...............................................................................................................
- Figure 48- After Use Button Sort
- Figure 49- Source Code Button Exit
- Figure 50- Program exit message
- Figure 51- Example of comment
- Figure 52- Example of Method
- Figure 53- Example of brace rule
- Figure 54-Example of Indentation and spacing............................................................................................
- Figure 55- Example of Prefixes
- Check if the user input data is missing or not Here is the Use case that is the interface of the program that I designed to solve the above situation: Figure 1 - Use Case
Figure 2 - Software interface
3.Chapter 2: Explain programming paradigms
3.1 Procedural Programming
- Procedural programming definition Procedural Programming (POP) is the first basic programming paradigm a new programmer will learn. Essentially, procedural programming is code that directly instructs a device how to complete a task in sequential order. Flowchart of the program's control flow organization. Procedural programming divides the program into functions if the program is too large. A function is simply a subroutine containing a series of steps to be performed. In a nutshell, Procedural Programming is writing a list of instructions for the computer to understand what it must do to complete the task required by the programmer. (Bhatia, 2021)
improve the readability and maintainability of the code. In addition, Functions can also be separated into modules that can be used for other programs. (Nguyen, 2019) Figure 4 - Function in C#
Using procedural programming in the program Here is an example where I applied procedural programming to my program: Figure 5 - Using Procedural Programming in the Program Figure 6 - Show charges for packages Here, I used the If-else function which is a feature of procedural programming to calculate the cost of each package. After entering the Add information, the user can see the cost of the package through the data Girdview on the screen. This function creates a constructor named “Fee” that takes only the value of the expression. If the weight is more than 5kg, the fee will be calculated according to the statement in the if function, otherwise, the statement in the else function will be executed. 3.2 Object-oriented programming
- Object-oriented programming definition Object-oriented programming (OOP) could be a fundamental programming paradigm employed by almost every developer at some point in their career. OOP is that the commonest programming paradigm and is taught because the standard way of coding for many programmers. Today we're aiming to break down the fundamentals of what makes an object-oriented program so you'll start using this pattern in your own projects and interviews (Doherty, 2020).
Abstract refers to the act of expressing nature without including basic details or explanations. Classes use abstraction and are defined as a storehouse of properties such as size, origin, cost, and functions to operate on these properties. They encapsulate all the essential properties of the thing declared in the class Properties are called data members because they contain data, and functions that operate this data are called member functions (Anon., n.d.).
4. Polymorphism Polymorphism means the power to possess quite one form. for instance, an activity has different behaviors under different circumstances. The behavior depends on the info type utilized in the operation (Anon., n.d.). Using object-oriented programming in the program Here is an example where I applied object-oriented programming to my program: Figure 8 - Object-Oriented Programming This is the line of code I apply object-oriented programming in my program. Here I have initialized a class named Product to declare objects like ProductID, ProductName, Destination, Weight. Here I have applied two characteristics of object-oriented programming that is encapsulation by adding {get; set;} for each constructor and polymorphism using method overloading with Product. The objects I declare in the
Product class will be used to display information on the main screen in the form of a data grid (Data Gridview). Figure 9 - Display the values of Object in the Product class 3.3 Event-driven programming
- Event-driven programming definition Event-driven programming is now the default paradigm in software engineering. because the name suggests, it uses events because the basis for software development. These events are often something the user is doing - clicking a selected button, selecting an option from a menu, entering text during a field, giving voice commands or uploading a video - or other events. system-generated events, like program loading (Helendi, 2018). Figure 10 - Event-driven programming
Figure 11 - Event-Driven Programming in Programming Here is an example of a left click event on the “Add” button to add the package information to the data table. First, I will run the “CheckInfo” function to make sure the user does not leave the Textboxes blank. Then I declare using intermediate functions to assign the values that the user has just entered. The intermediate variables will reassign values to the variables declared in this Product class through the Product function and then display the results on the user interface. After that, the Textboxes will be blanked so that users can enter more packages. 3.4 The relationship between procedural programming, object-oriented programming and event-driven programming. After learning through the above three programming methods, my personal views on the relationship between these three methods are as follows: The core of the above three programming methods remains procedural programming. Procedural programming means you define a program and its subroutines as a sequence of steps. In contrast, declarative programs plan to describe the result without reference to the steps taken to computerize it but with some description or representation of the specified result. These are overcome by object-oriented
programming methods. Object-oriented programming could be a way of organizing code in classes of component objects toward the most object of the problem. Object-oriented programming focuses on four characteristics: encapsulation, inheritance, abstraction, and polymorphism. However, the objects within the class still got to follow procedural programming. However, these two programming methods still run on the console interface (black background and write font). That's why event-driven programming was born to assist programmers to catch events that users can use on the Win-Form platform. Events will be many but the foremost common continues to be the "click" event. Event-driven programming relies on procedural methods for event handling and has the core event loop provided by the underlying system. This manner you'll save the effort of writing your own event loop and enjoy the varied libraries that already work with the system provided event loop. Event-based programs are fairly often written using an object-oriented style, but not always.
4. Chapter 3: IDE features
4 .1 IDE definition
An integrated development environment (IDE) is software for building applications that mixes common developer tools into one graphical interface (GUI) (Anon., n.d.). An IDE typically consists of:
- Source code editor: A text editor which will assist in writing software code with features like syntax highlighting with visual cues, providing language-specific auto-completion, and checking for bugs as code is being written (Anon., n.d.).
- Local build automation: Utilities that automate simple, repeatable tasks as a part of creating an area build of the software to be used by the developer, like compiling computer ASCII text files into code, packaging code, and running automated tests (Anon., n.d.).
- Debugger: A program for testing other programs which will graphically display the situation of a bug within the original code (Anon., n.d.).
4 .2 Features of IDE with illustrations Some common features that a developer has access to in an IDE:
- Text editor Almost every IDE will have a text editor designed for writing and manipulating source code. Some tools may have visual elements for dragging and dropping UI elements, but most have an easy interface with language-specific syntax highlighting (Walker, 2018). Figure 14 - Text editor in Visual Studio 2019
- Debugger Debugging tools assist users in identifying and correcting errors in ASCII text files. They often simulate real-world scenarios to test the program's functionality and performance to their requirements (Walker, 2018).
Figure 15 - Debug Mode in Visual Studio 2019
- Compiler A computer can be a component that translates a programming language into a machine-processable form, such as code. Machine language is analyzed to ensure its accuracy. The compiler then parses and returns the results of the parsed syntaxes (Walker, 2018).