ASSIGNMENT 2 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 23/12/2022 Date Received 1st submission 24/12/2022 Re-submission Date Date Received 2nd submission Student Name Tran Duc Long Student ID GCH210562 Class GCH1106 Assessor name Pham Danh Tuyen 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 D4 Page 1 of 66 Summative Feedback: Resubmission Feedback: 2.3 Grade: Assessor Signature: Date: Lecturer Signature: Page 2 of 66 Table of Contents A. Task 1: Introduction to your program (P3).
Introduce the Overview/ Context of the problem. List out the application’s requirements. How can my program solve the problem:. Task 2: Explain programming paradigms(P2).1 Explain what is Procedural Programming with source code and illustrations .2 Explain what is Object-Oriented Programming with source code and illustrations .3 Explain what is Event-Driven Programming with source code and illustrations .4 The relationship between them .5 Conclude which paradigms will be used to develop the application with explanation.
Task 3: IDE features(P4-M2-M3-M4) .1 Introduce what is IDE .2 Introduce features of IDE with illustrations. 17 b) Other IDE tools: .3 An explanation and evaluation of the debugging process in the IDE used and how it helped with development.4 Evidences that you have used debugging during the implementation .5 An evaluation of developing applications using an IDE versus developing an application without using an IDE. Task 4: Design and Implementation(P3-P5) .1 Flowchart of the application .2 Source code and screenshots of the final application with explanation. Screenshots of the program:.
Source code of the program: .3 Explain and evaluate coding standards used in the program .4 Explain the benefits of using coding standards .5 Evaluate my entire program:. 64 Table of figures Figure 1: Procedural paradigm (Vats. 8 Figure 2: Foreach in POP. 8 Figure 3:OOP paradigm (Vats, 2022).
9 Figure 4:Object-oriented paradigm characteristics (Doherty, 2020). 10 Figure 5: Interface in OOP. 10 Figure 6: Event-driven paradigm (Anon. 11 Figure 7: Event-driven paradigm characteristics (Baral, 2012).
12 Figure 8: Event button in Event-driven. 12 Figure 9: Loop for in my program. 13 Figure 10: Loop foreach in my program. 13 Figure 11: if-else in my program.
14 Page 4 of 66 Figure 12: Switch in my program. 14 Figure 13:Class book in my program. 15 Figure 14: An event listener in my program. 16 Figure 15: Event button Cancel in my program.
16 Figure 16: Screenshot of an IDE. 18 Figure 17: Debugging section. 20 Figure 18: Break point. 20 Figure 19: Start debugging.
21 Figure 20: Expected result. 22 Figure 21: Algorithm linear search with IDE. 22 Figure 22: User case in my program. 24 Figure 23: Flowchart my program.
25 Figure 24: Algorithm linear search to find book's location. 25 Figure 25: Flowchart of methods searching in my program. 26 Figure 26:Flowchart of methods sorting in my program. 27 Figure 27: method form Login in my program.
28 Figure 28:Event update and remove books in my program. 28 Figure 29: Class diagram of my program. 29 Figure 30: form Loading in my program. 30 Figure 31: Form Login.
30 Figure 32: Form Program. 31 Figure 33: Form to add and update Book. 31 Figure 34: Message box to exception handling. 32 Figure 35: List book.
32 Figure 36: Book already exists. 33 Figure 37: Save book's information. 33 Figure 38: Example: sorting book by date added. 34 Figure 39: Example: searching by book's name in my program.
34 Figure 40: Click button Edit. 35 Figure 41: Click button delete. 36 Figure 42: Edit color. 36 Figure 43: Click button refresh.
37 Figure 44:View code of form frmRunning. 38 Figure 45: View code of form Login. 39 Figure 46: Class Book. 40 Figure 47: interface IChecker in my program.
41 Page 5 of 66 Figure 48: Class CheckerImp to exception handling. 41 Figure 49: interface IController in my program. 42 Figure 50:Methods searching in my program. 45 Figure 51: Methods sorting in my program.
48 Figure 52: Interface IViewController in my program. 48 Figure 53: View code frmProgram. 55 Figure 54: View code of AddUpdateForm. 58 Figure 55: Layout in my program.
59 Figure 56: White space in my program. 60 Figure 57: Indentation in my program. 60 Figure 58:Naming rules:. 61 Figure 59:Types note in my program.
Task 1: Introduction to your program (P3) 1. Introduce the Overview/ Context of the problem Everything in our current civilization is modern and inventive. Every day, there is a great deal of innovation, particularly in technology. We must acknowledge that technology has invaded every part of our life, from basic gadgets like phones and computers to complicated programming programs.
In this assignment, I will talk about library management, or called librarian software, precisely how I can use it, as well as extensive explanations of its features and characteristics, and ultimately an evaluation of the functions and the overall program. In addition, I included many alternatives in my application for users to choose from, each with its own purpose and information to allow them to develop a range of programs. These capabilities will aid the archivist in entering the book's information such as type book., as well as finding which author. List out the application’s requirements This system will give the archivist power and flexibility to manage the entire book from a single online portal.
Librarians can do: + Create a new book including id, name, type book, adding date , and author. + Edit/delete/save the book's information. + Sorting books by name/type book/added date/author/id. + Searching for books by name/type book/id/date of adding/author.
How can my program solve the problem: + After the user logs into the program, there will be a total screen including the functions. + When user press new/add books button, program will show a form where they can enter book’s information then book's information will show on main screen. + Users can edit/delete/save/refresh the information books have just entered according to the corresponding messageBoxes. + Users can view sorted book’s information as well as search for books through menu 2 combobox sort and search on the main screen.
Task 2: Explain programming paradigms(P2) 2.1 Explain what is Procedural Programming with source code and illustrations Page 7 of 66 • Procedural programming is a programming paradigm that teaches a computer to execute a program logically. Fundamentally, procedural programming is the process of writing a set of instructions that the computer may follow step by step. The procedural programming paradigm divides codes into processes, with each block of code performing a specific purpose. Procedures, often known as routines, subroutines, or functions, are essentially a collection of computing processes that must be performed in the sequence specified by developers.) Figure 1: Procedural paradigm (Vats.R,2022) • Procedural paradigm characteristics: + Procedural program models imitate real-world processes on data.
+ Data flows freely throughout a software. + The program's flow is simple and straightforward. + Big jobs are broken down into smaller ones (functions). + Uses a top-down approach to program design.
+ The majority of functions exchange global data. (Chakrabarty, 2013) • Example code: Figure 2: Foreach in POP Page 8 of 66 2.2 Explain what is Object-Oriented Programming with source code and illustrations • Object-oriented programming (OOP) is a fundamental programming paradigm that almost all developers employ. The most common programming paradigm and the conventional approach to code are OOP. It is a programming paradigm centered on classes and objects rather than functions and logic.
It is used to divide a software program into basic, reusable classes that may then be utilized to produce individual instances of things. Object-oriented programming languages include JavaScript, C#, Java, and Python. A class is a type of object that is used to construct distinct, concrete things. Classes, like functions in procedural programming, can contain methods, but they are only available to objects of that kind.
These functions, which are specified within the class, carry out some operation. Figure 3:OOP paradigm (Vats, 2022) • Object-oriented paradigm characteristics: + Encapsulation: data and information concealment Page 9 of 66 + Abstraction: displays just important qualities and conceals irrelevant information. + Inheritance: the ability to derive a class for a hierarchy from another class. + Objects: an object is a class instance.
+ Class: a group of objects with similar properties (Doherty, 2020). Figure 4:Object-oriented paradigm characteristics (Doherty, 2020). • Example code: Figure 5: Interface in OOP Page 10 of 66 2.3 Explain what is Event-Driven Programming with source code and illustrations • "Event-driven programming is a programming paradigm in computer programming in which the flow of the program is governed by events such as user actions (mouse clicks, key presses), sensor outputs, or message passing from other programs or threads," according to Wikipedia. Event-driven programming is the prevalent paradigm in graphical user interfaces and other programs (for example, JavaScript web applications) that are focused on doing specific actions in response to user input.
This is also true for device driver programming (e., P in USB device driver stacks). A main loop in an event-driven application normally listens for events and then calls a callback function when one of those events is recognized. In embedded systems, this can be accomplished by employing hardware interrupts rather than a continually running main loop. Event-driven applications may be developed in any programming language, however languages with high-level abstractions, such as await and closures, make the work simpler.) Figure 6: Event-driven paradigm (Anon.) • Event-driven paradigm characteristics: + Service-Oriented: The service-oriented requires less computer resources and typically runs in the background of the operating system.
+ Time-Driven: code that only executes at a given time. Page 11 of 66 + Trigger Functions: These are functions that run when a specified event occurs. + Events: The user must interact with a software object (click a button by a mouse, use the computer keyboard to choose a button). + Programming Simplicity and Development Ease: Event-driven programming is significantly simpler and easier to implement than other types of programming.
For example, you may place a button by choosing it, dragging it to a form, and assigning it a listener. Figure 7: Event-driven paradigm characteristics (Baral, 2012) • Example code: Figure 8: Event button in Event-driven Page 12 of 66 2.4 The relationship between them • Because of increased consumer demand, programs/applications are getting increasingly complicated. Developers mix two or three programming paradigms in one software to simplify them. Here's how they may be combined in a program: + The procedural paradigm represents the issue solution, defining procedures and data flows.
+ Looking at models and developing objects to represent those models is what object oriented is all about. + When events are triggered, the event programming paradigm generates actions for both procedural programming and programming objects, which aid in the development of human engagement with the program.5 Conclude which paradigms will be used to develop the application with explanation. In my program, I have used procedural programming, object-oriented programming and event- driven paradigms. • Procedural programming: Firstly, I used for and for each loops to conduct tasks like as looking for book information.
I also used if-else and switch statement to test the condition when the user entered data. This simplifies and makes the code easier to understand.