Download Assignment 2 Programing - 1618 and more Assignments Computer Programming in PDF only on Docsity!
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/ Re-submission Date Date Received 2nd submission Student Name Tran Duc Long Student ID GCH 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 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date: Lecturer Signature:
A. Task 1: Introduction to your program (P3)
1.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.
1.2. 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.
1.3. 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.
A. Task 2: Explain programming paradigms(P2)
2.1 Explain what is Procedural Programming with source code and illustrations
- 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. (isaaccomputerscience, n.d.) 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, 20 13 )
- Example code: Figure 2 : Foreach in POP
- 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
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.g., 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." (Anon., n.d.) Figure 6 : Event-driven paradigm (Anon., 2021.)
- 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.
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.
2.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. Figure 9 : Loop for in my program Figure 10 : Loop foreach in my program
Figure 11 : if-else in my program Figure 12 : Switch in my program
- Object-Oriented Programming: Secondly, I mostly user Object-Oriented Programming Paradigm because it suitable for the scenario. I can create class of books in OOP.
Figure 14 : An event listener in my program Figure 15 : Event button Cancel in my program
B.Task 3: IDE features(P4-M2-M3-M4)
3.1 Introduce what is IDE
An integrated development environment (IDE) is application development software that integrates common developer tools into a single graphical user interface (GUI). An IDE is often made up of the following components:
- Source code editor: A text editor that can help you write software code by highlighting syntax with visual clues, giving language-specific auto-completion, and checking for flaws as you type.
- Local build automation: Tools for automating simple, recurring operations associated with making a local build of software for usage by developers, such as converting computer source code into binary code, packaging binary code, and performing automated tests.
- Debugger: A software that can graphically indicate the location of a defect in the original code and is used to test other applications. Because different tools do not need to be manually installed and integrated as part of the setup process, an IDE allows developers to start writing new apps fast. When every utility is represented on the same workbench, developers no longer need to spend hours separately learning how to utilize different tools. This is also valuable for onboarding new engineers, who may use an IDE to learn about a team's standard tools and procedures. In reality, most IDE capabilities, such as intelligent code completion and automatic code creation, are designed to save time by eliminating the need to write out whole character sequences. (redhat.com, 2019)
3.2 Introduce features of IDE with illustrations
a) Code editor: The shell is the environment in which the user may write code. The code editor is a text editing area where developers may write, modify, and save code documents. It has capabilities that aid in the authoring and modification of code. These are some examples:
- Auto-completion (or code completion)
- Bracket matching
- Syntax checks b) Other IDE tools:
- Translator. This compiles or interprets the code.
- Documentation for automobiles. This defines the function and purpose of the code, for example, by identifying the modules and variables used, as well as its anticipated behavior, and compiles this information into a text file that other developers may use to understand how and why the code was generated.
- Libraries. These provide functions that are not included in the programming language's core. These functions can be imported and utilized in the program code at the beginning. In Python, for example, the Turtle Graphics module gives access to some basic drawing and graphics capabilities.
Procedure: I used Microsoft Visual Studio Community 2022 to implement the solution to this situation.
- The debugging procedure:
- Recognizing a mistake.
- Locate the error (at line...).
- Correct the mistake.
- Rerun the application to see if any errors remain.
- The debugging procedure will assist us in locating and correcting program errors, making the application usable and bug-free. Evaluation: Evaluation: A debugger is a software tool that can help with software development by finding code mistakes at various phases of operating systems or application development. Some debuggers will evaluate the test run and establish break points to see which lines of code are not executed. This tool allows coders or rookie IT students like me to waste less time looking for issues and more time solving them. This feature also makes it easy for coders or programmers to keep their applications updated.
3.4 Evidences that you have used debugging during the implementation
- I will debug this code section:
Figure 17 : Debugging section
- I will put a break point at the line I need to debug. Figure 18 : Break point
- Next, I will start debugging, the program will run until the breakpoint.