Procedural Programming and Object-Oriented Programming, Summaries of Network Design

An overview of two major programming paradigms: procedural programming and object-oriented programming (oop). It discusses the key features, advantages, and disadvantages of each paradigm. Procedural programming is described as a linear, top-down approach where the program is divided into procedures or functions. It is suitable for general-purpose programming and has advantages like code reusability and easy program flow tracking, but can be harder to write and less secure. Object-oriented programming, on the other hand, organizes software design around data or objects rather than functions and logic. It offers benefits like improved software maintenance, faster development, and better quality through detailed testing, but can also be more complex and lead to slower-running programs. The document also touches on the relationship between these two programming paradigms and their practical applications in software development.

Typology: Summaries

2021/2022

Uploaded on 08/19/2022

hoang-nghia-duong-btec-hn
hoang-nghia-duong-btec-hn 🇻🇳

4 documents

1 / 17

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

Partial preview of the text

Download Procedural Programming and Object-Oriented Programming and more Summaries Network Design 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:

5 A. INTRODUCTION B. CONTENT I. Procedural, Event Driven and Object Orientated Programming:

  1. Procedural programming: Procedural Programming may be the first programming paradigm that a new developer will learn. Fundamentally, the procedural code is the one that directly instructs a device on how to finish a task in logical steps. This paradigm uses a linear top- down approach and treats data and procedures as two different entities. Based on the concept of a procedure call, Procedural Programming divides the program into procedures, which are also known as routines or functions, simply containing a series of steps to be carried out. Simply put, Procedural Programming involves writing down a list of instructions to tell the computer what it should do step- by-step to finish the task at hand. 1.1 Structure-oriented programming features:  Focus on the work to be done (algorithms)

 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  Data in the system is moved from one function to another.  Function that converts data from one form to another  Using a top-down approach in program design I.1.1 Advantages and disadvantages: Procedural Programming comes with its own set of pros and cons, some of which are mentioned below.  Advantages:

  • Procedural Programming is excellent for general-purpose programming.
  • The coded simplicity along with ease of implementation of compilers and interpreters.
  • A large variety of books and online course material available on tested algorithms, making it easier to learn along the way.
  • The source code is portable, therefore, it can be used to target a different CPU as well.
  • The code can be reused in different parts of the program, without the need to copy it.
  • Through Procedural Programming technique, the memory requirement also slashes.
  • The program flow can be tracked easily.  Disadvantages:
  • The program code is harder to write when Procedural Programming is employed.
  • The Procedural code is often not reusable, which may pose the need to recreate the code if is needed to use in another application.
  • Difficult to relate with real-world objects.
  • The importance is given to the operation rather than the data, which might pose issues in some data-sensitive cases.
  • The data is exposed to the whole program, making it not so much security friendly. There are different types of programming paradigm as we mentioned before, which are nothing but a style of programming. It is important to understand that the paradigm does not cater to a specific language but to the way the program is written. Below is a comparison between Procedural Programming and Object-Oriented Programming.

2.1 Characteristics of object-oriented programming: Abstraction Inheritance Encapsulation Polymorphism 2.1.1 Advantages and disadvantages:  Advantages: a. Flexibility: Programmers that use event-driven can be altered easily if the programmer wants something to be changed. This paradigm allows the programmer to produce a form of their requirements. Programmers who are event-driven can be put together without too many problems and also the code and design can be easily altered because if something isn't right.

b. Suitability for Graphical Interfaces: Event-driven allows the user to select different tools from the toolbar to directly create what they need such as buttons, radio buttons, etc. This also allows people to put objects where they want them and can directly edit. Some people find it easier to directly click on the thing they want to edit. c. Simplicity of Programming: Event-driven can make programming easier for some by being able to directly edit the object you want the code for. Another thing that can make the programming easier is that when using an event driven language such as visual basic it usually has predictive coding so when the user is coding it will predict what you want to do from what you are typing. d. Easy to Find Natural Dividing Lines: it is easy to find natural dividing lines for unit testing infrastructure. e. Highly Compostable: It is highly compostable. f. Simple and Understandable: It allows for a very simple and understandable model for both sides of the DevOps Bridge. g. Purely Procedural and Purely Imperative: Both purely procedural and purely imperative approaches get brittle as they grow in length and complexity. h. A good way to Model Systems: It is one good way to model systems that need to be both asynchronous and reactive.

Possible tight coupling between the event schema and the consumers of the schema. g. Blocking: Reasoning about blocking operations might be becoming more difficult. https://aiven.io/blog/introduction-to-event-based-programming https://benchpartner.com/advantages-and-disadvantages-of-event-driven-programming

  1. Object Oriented Programming: Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This approach to programming is well-suited for programs that are large, complex and actively updated or maintained. This includes programs for manufacturing and design, as well as mobile applications; for example, OOP can be used for manufacturing system simulation software. The organization of an object-oriented program also makes the method beneficial to collaborative development, where projects are divided into groups. Additional benefits of OOP include code reusability, scalability and efficiency. The first step in OOP is to collect all of the objects a programmer wants to manipulate and identify how they relate to each other -- an exercise known as data modeling. Examples of an object can range from physical entities, such as a human being who is described by properties like name and address, to small computer programs, such as widgets.

Once an object is known, it is labeled with a class of objects that defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. Objects can communicate with well-defined interfaces called messages. 3.1 Characteristics of object-oriented programming:  Object-Oriented Development (OOD)  Encapsulation  Abstraction  Classes and Objects  Inheritance and Composition  Binding  Message Passing 3.1.1 Advantages and disadvantages:  Advantages: a. Highly productive software development:

OOP is a modular type of programming, which means that it distinguishes between different duties and

allows objects to be extended. In other words, objects can be given fresh attributes and become reusable.

b. Easier software maintenance:

Other programming systems require major structural changes in case of updates or new features. On the

other side, OOP makes it possible to focus on individual modules only and simplify software maintenance.

OOP is not suitable for some sorts of programs. This downside of OOP actually applies to all programming

styles because there is no solution that suits all types of problems.

https://www.interviewbit.com/blog/characteristics-of-object-oriented-programming/

https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP

https://arkconsolecommands.com/advantages-and-disadvantages-of-object-oriented-programming-oop/

4. The relasionship between the 3 programming paradigms:

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-oriented programming, it applies to large systems and problems. However, it has not been used for

practical applications.

To make a problem of the practice or the practical application, instructive object and event modeling models

must be used to construct a system application implementation (e.g. student management program, book

management...).

II. IDE Algorithm Settings:

Here, I would like to present the hotel management application using the windows form application

The application has the following features:

  1. To manage the room I need to declare the room name, room number, room category, status and room price.

3. When you want to exit the application, press the exit button.

In the above code I have taken the data from the textbox and put it into the DataGridView.