Programming Paradigms and IDE Features: A BTEC Level 5 HND Diploma in Computing Assignment, Exercises of Information Technology

ASM DEMO Information technology

Typology: Exercises

2018/2019

Uploaded on 04/12/2023

nguyen-djang-khanh-hang-fgw-dn
nguyen-djang-khanh-hang-fgw-dn 🇻🇳

12 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 2 FRONT SHEET
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
Student ID
Class
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
Grading grid
P2
P3
P4
P5
M2
M3
M4
D2
D3
D4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Programming Paradigms and IDE Features: A BTEC Level 5 HND Diploma in Computing Assignment and more Exercises Information Technology 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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class 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 Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

  • SECTION 1: EXPLAIN PROGRAMMING PARADIGMS (P2)
      1. Procedural Programming:
      1. Object-Oriented Programming:
      1. Event – driven paradigm:
      1. The relationship between procedural, object-oriented and event-driven paradigms:
  • SECTION 2: INTRODUCTION TO MY PROGRAM (P3)
      1. Introduce the Overview/ Context of the problem:
    • List out application’s requirements:........................................................................................................................
  • SECTION 3: IDE FEATURES (P4)
      1. IDE:
      1. Features of IDE:
      1. The debugging process:
      1. The debugging facilities available in the IDE:
  • SECTION 4: DESIGN AND IMPLEMENTATION ( P3 – P5)
      1. Flowchart of the application:
      1. Source code and screenshots of the final application with explanation:
      1. The coding standard
  • References:
  • Figure 1: PROG...............................................................................................................................................................
  • Figure 2: Example1 PROG
  • Figure 3: : Example2 PROG
  • Figure 4: OOP.................................................................................................................................................................
  • Figure 5: Example OOP
  • Figure 6: Event – driven paradigm
  • Figure 7: Example Event – driven paradigm
  • Figure 8: IDE.................................................................................................................................................................
  • Figure 9: Features of IDE
  • Figure 10: Debugging
  • Figure 11: Debugging Process
  • Figure 12: Example1 Of Debugging tools
  • Figure 13: Example2 Of Debugging tools
  • Figure 14: Example3 Of Debugging tools
  • Figure 15: Flowchart of Menu
  • Figure 16: Flowchart of Input
  • Figure 17: Flowchart of Display
  • Figure 18: Flowchart of Searching
  • Figure 19: Declare........................................................................................................................................................
  • Figure 20: Switch case
  • Figure 21: Input
  • Figure 22: Display
  • Figure 23: Searching
  • Figure 24: Delete
  • Figure 25: Borrow
  • Figure 26: Return
  • Figure 27: Menu
  • Table 1: Relationship

1 .2. Source code:

  • I use this function to input IDs student. Here, I use a for loop and certain conditions (as shown below) to make sure that no IDs are duplicated. Figure 2 : Example 1 PROG
  • In the input of student scores, to make sure that the student's score will be between 0 and 10, I used a while loop so that the program only runs when the score is entered in the allowed range. Figure 3 : : Example 2 PROG ➢ Explanation: Data and functions are separated in procedural programming. A program is often developed from the top down (or, in some situations, from the bottom up) via functional decomposition or step-by-step refining. The purpose of the above function is to enter student information including ID and grades. Besides, in this function also checks ID duplicated.

2. Object-Oriented Programming: 2 .1. Definition: − Object-Oriented Programming (OOP) is a computer science programming paradigm that is based on the concepts of classes and objects. It is used to divide a software program into basic, reusable code blueprints (typically referred to as classes), which are then used to build individual instances of objects. Figure 4 : OOP − Characteristics of OOP: o Class definitions: The fundamental building blocks of OOP and a single entity that contains data and operations on data. o Objects: The instances of a class which are utilized in real functionality - its variables and actions o Abstraction: Specifying what to do but not how to accomplish it; a versatile characteristic for gaining a comprehensive understanding of an object's functioning. o Encapsulation: Binding data and actions of data together in a single unit - This characteristic is adhered to by a class. o Inheritance and class hierarchy : Class reusability and extension

3. Event – driven paradigm: 3.1. Definition: − A software that is event-driven responds primarily to user events or other comparable input. The notion of event-driven programming is significant in application development and other types of programming, and it has given rise to event handlers and other resources. It is also known as an event-driven application Figure 6 : Event – driven paradigm − Characteristics of Event-Driven Programming: o Declarative vs. Imperative: Most of us develop imperative programs, where statements are performed in a certain order to modify the application state. The code is run, and we reach a conclusion.

When the state is calculated, it does not change when the underlying components change. Event-driven programming, on the other hand, is concerned with the transmission of change. It is also known as declarative programming since we specify our goal yet the application's state is defined dynamically by changes in underlying causes. Imperative methods such as callbacks can be used to create event-driven programming. This may be sufficient for a program with a single event. However, in systems with hundreds of events every second, this might quickly lead to callback hell. We may have several callbacks dependent on one another, making it impossible to determine which ones were being executed. As a result, we need a new set of abstractions to design asynchronous, event-driven interactions across network boundaries. These abstractions are provided by libraries in many languages, such as Java. These libraries are referred to as Reactive Extensions. o Push vs. Pull: There are two types of reactive programs: push-based and pull-based. The pull-based system waits for a subscriber request to push the data. This is the classic case where the data source is actively asked for further information. At the code level, this uses the iterator pattern, and the Iterable interface is especially built for synchronous applications, as the program might block while retrieving data. On the other hand, a push-based paradigm accumulates events and pushes through a succession of listeners to perform the computation. Unlike the pull-based method, data and relevant changes are delivered to the subscriber from the source in this scenario (Observable sequences in this case). This asynchronous nature is achieved by not blocking the subscriber and instead requiring it to react to changes. As you can see, using this push method is more advantageous in rich UI situations where you don't want to stop the main UI thread while waiting for events. This becomes ideal, therefore making event-driven programs responsive. o Async vs. Sync Because the system components do not interact directly or wait for a response from each other, event-driven programming might be deemed asynchronous. Services that take part in communication merely post a message and then move on. Anyone who is interested can listen to the event whenever it is convenient for them. Asynchronous implies there is no waiting time. The caller function does not wait for a response from the called service; it continues completing its next job. Waiting time is defined as synchronous. The caller must wait for a response from the summoned service before proceeding to the next job. The calling service must wait

Figure 7 : Example Event – driven paradigm ➢ Explanation: An event is something we do, such as publishing this article or reading this article. Every action we take is an event. To demonstrate event-driven programming, I'd want to write a tale and demonstrate how I can use events to explain a real-world issue. We can plainly see that two things are primarily engaged in the aforementioned dilemma. Parent and I are the first (Student). So, when my score is released, I must notify my mom.

4. The relationship between procedural, object-oriented and event-driven paradigms: Procedural Programming Object Oriented Programming Event Driven Programming Allows you to write commands using a character user interface. Provides command writing in modules. Creates applications using a graphical user interface. Commands are written in a linear form and are likewise executed in a linear method. Objects and functions are ready for interaction in order to complete certain tasks. On events, actions are defined. These events might be triggered by mouse movements or keyboard strokes. The emphasis is on the sequential execution of steps. Concentrates on items or data and helps to protect them from unlawful access. The emphasis is on picking the user interface. Most prevalent languages which follow this paradigm include Basic, Fortran and COBOL. Smalltalk, C++, and JAVA are the most prevalent languages that adhere to this paradigm. Visual Basic and C# are the most prevalent languages that adhere to this paradigm. Table 1 : Relationship SECTION 2 : INTRODUCTION TO MY PROGRAM (P3) 1. Introduce the Overview/ Context of the problem: ✓ A Library Management System is software designed to perform a library's core housekeeping responsibilities, making management easier and faster. Library management systems assist libraries in keeping track of books, checkouts, and membership subscriptions and profiles. ✓ Maintaining the database for inputting new books and documenting books borrowed with their corresponding due dates is another part of library management systems. List out application’s requirements: ✓ As a user, I want any library member to be able to search books by their title, author, topic area as well by the publication date. ✓ As a user, I want the system to be able to obtain information what books a specific library user has checked out. ✓ As a user, I want to add and update books with information such as title, author, publication date, and category.

front-end components, but the majority offer a basic interface that highlights language-specific grammar. − Debugger: After the software has been created, it must be examined for flaws and errors. A debugger is a software that identifies faults and halts program execution. Right before you realize what's going on. The Debugger is essentially a software that stops the code at a certain line and finds problems. A debugger is a software that programmers use to test and debug the target platform. For example, suppose you are developing a code in java. A Java Debugger simply verifies your code by running it on a Java platform and displaying the error as well as where it was identified. As an example, suppose you omitted the semicolon. Then it will display the Syntax error and allow you to correct it before running the application. This allows you to resolve the issue before compiling. Debugging tools aid users in locating and correcting mistakes in source code. To evaluate functionality and performance, they frequently imitate real-world scenarios. Before releasing an application, programmers and software engineers may generally test various code parts and find issues. − Compiler: After writing the program, it should be turned into machine language. Computers understand binary (i.e. 0 and 1). Languages include Assembly language, binary language, and machine language. These languages are the only thing that computers can understand. Whatever you write in the text editor, whether in Python, Java, C++, C#, or C, it must be transformed into Machine Languages or Binary. This is why we require a Compiler. Compilers are software components that convert programming language to machine code. The machine code is examined for correctness. − Code completion: The term "electronic commerce" refers to the sale of goods and services through the internet. This functionality saves developers time while developing code and decreases the possibility of mistakes and problems. − Programming language: IDEs generally supported a single programming language. However, some IDEs support numerous languages. As a result, the first step is to determine which languages you will be coding in and then filter down your potential IDE choice appropriately. Ruby, Python, Java IDE, and Visual Studio tools are some examples. − Integrations and plugins: It comes as no surprise that interconnections must be addressed while evaluating IDEs, given the moniker integrated development environment. Becauseyour IDE serves as your working environment, integrating all of your other development tools will increase development processes and productivity. Poor integration can lead to a variety of problems.

Figure 9 : Features of IDE

3. The debugging process: 3.1 Debugging: − Definition: Debugging is a computer programming method for locating and correcting flaws in software or a website, sometimes known as bugs. Identifying the cause of an issue and developing ways to guarantee a software runs smoothly for users in the future typically necessitates a complete approach. Figure 10 : Debugging 3. 2 Debugging Process: 3.2.1. Definition:

Figure 11 : Debugging Process

4. The debugging facilities available in the IDE: a. Debbugging in the IDE: ✓ The source-level debugger is a tool that is widely used in the typical design-develop-debug cycle. This powerful tool in the IDE provides an intuitive debugging environment that is seamlessly connected with the other workbench tools, providing you the freedom you need to effectively solve the challenges at hand. ✓ The IDE debugger makes use of GDB as the underlying debug engine. It converts each GUI action into a sequence of GDB instructions and then analyzes the GDB output to display the current state of the application being debugged. 4.2. The debugging facilities available in the IDE: 4.2.1. Debugging tools: − Code Editor: IDEs often have the ability to highlight syntaxes in code with different colors, so that programmers can easily distinguish them, easy to link code with together.

Figure 12 : Example 1 Of Debugging tools − Code highlight: When an IDE detects a syntax issue, it will typically aid you by highlighting the section of code that contains the error. Figure 13 : Example 2 Of Debugging tools − Syntax autofill: Sometimes you will have trouble remembering the syntax in a statement, or you simply don't want to repeat the typing of those syntaxes. IDEs will help solve this problem because they will predict what syntax you are going to type. Note, these syntaxes will vary depending on the programming language you use. Figure 14 : Example 3 Of Debugging tools SECTION 4: DESIGN AND IMPLEMENTATION ( P3 – P5)

1. Flowchart of the application: 1.1. Flowchart of menu: