Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

AS

SIGNMENT 1
NDIT, SOFTWARE DESIGN AND DEVELOPMENT

SPRING SEMESTER (2021-1)

SUBMITTED TO:

MOHAMMAD IFTAKHAR ALAM

LECTURER

SCHOOL OF IT

SUBMITTED BY:

SHAHRIAR SHAMIR HASAN (2021126004)

Feburary 15, 2021


DESCRIBE THE APPLICATION AND LIMITS OF
PROCEDURAL, OBJECT-ORIENTED, AND EVENT-DRIVEN
PROGRAMMING PARADIGMS

There are several different types of languages that have a different paradigm. Some programming languages use a
combination of different paradigms. Paradigms are the key feature and structure of the programming language. Three
of the most important programming paradigms are event-driven, procedural, and object-oriented.

Procedural Programming Paradigm

The procedural programming paradigm uses a top-down problem-solving approach. It treats data and procedure as
two different entities. The paradigm uses multipole procedures also known as a routine, subroutine, or function to
complete the program. These functions are reusable and can have unique behavior and attributes.

Procedural Programming

When we use the procedural programming language to code, we break down the main program into smaller parts
and call them procedures. Each procedure is programmed for a specific task and is called by the main program when
needed. Procedure programming is fairly easy to learn but it is hard to write, but it is user-friendly thus it is always a
suitable language for beginners.

Procedural programming is used for different types of calculations. It is a simple programming language that works
well with a basic system. Mention some disadvantage

Object Oriented Programming Paradigm

The object-oriented programming paradigm uses a bottom-up approach to solve problems. Problems are represented
as objects that are made up of data and functions. Communication between objects is made using functions but the
data in a function is exclusive to the particular function of an object, and cannot be accessed by other functions thus it
can’t be modified.

Object Oriented Programming

Object oriented programming revolves around objects. Programs are made up of objects which include various data
and functions. Objects are defined by classes for their values and behavior. Object oriented programming language is
used for complex problem-solving in an advanced system since it has a more adaptive and flexible programming
structure when compared with procedural programming. Objects in this programming language mimic real-life
objects, that is why it is easily understandable. Also, objects that make up the program are self-sufficient thus can be
easily reused in other parts of the program. Mention some disadvantages

Event-driven Programming Paradigm


In an event-driven programming paradigm flow of the program is determined by events. Events are defined as actions
by users such as mouse click, pressing a button, setting up a notification, etc. Input from the events is sent to the
scheduler, which determines the type of event and forwards the response to the appropriate event handler for
output. The modern operating system uses GUI and integrates this paradigm for a providing a fulfilling user
experience.

Event-driven Programming

Event-driven programming allows a program to respond according to the input by the user. Even though event-driven
programming is different from other programming languages, all object-oriented and visual languages utilize event-
driven programming. Event-driven can be written in any programming language. Programmers construct event
procedures that respond to various user inputs.

How these languages can be combined

Every program is aimed at solving different aspects of a problem but we cannot use different types of paradigms
together as they are not mutually exclusive. The modern programming language combines aspects of different
paradigms, this way it enables us to use a unique language with improved functionality. For example, languages like
Visual basic, which is a procedural language but uses some features of Object-oriented language.

Why these languages are important

Machine code is a low-level programming language that a computer uses to pass commands and to communicate. A
programming language allows us to communicate and program computers without learning machine code.
Programming a computer would be a lot slower and harder if we had to use machine code which consists of binary
and hexadecimal numbers. The programming language was invented for ease of use, it is human friendly and highly
functional. It is also easy to use and learn for human beings, thus allowing us to effectively program computers.

Types of languages

1. Scripting languages
A scripting language is used for writing computer scripts, they are used in software applications, web pages and
sometimes in operating system shells and games, most modern structure supports scripting language. A scripting
language is a series of command and does not need a compiler to be executed, can be interpreted. It is fast, short
series of codes, and supports cross-platform mean it does not require additional software to be installed to run
them. JavaScript is a scripting language that is combined with HTML for web development.

2. Mark-up languages
Mark-up language is not classified as a programming language but presents itself as a programming language. It is
used for text processing, formats the text, and manages the style and structure of a document. There are many
different kinds of mark-up language but the most common one is HTML (hypertext mark-up language) which
helps with the basic layout and style of the text of a web page. Mark-up languages are used with other scripting
languages to make a functional website.
DESCRIBE THE FACTORS INFLUENCING THE CHOICE OF
PROGRAMMING LANGUAGE

Choosing the Right Programming Language

There is about 700 programming language, so for an organization choosing the right type of programming language
can be difficult and very important as well. There are numerous elements that an organization considers when they
chose a programming language, below are the factors that influence when choosing a programming language.

Factors Influencing the Choice of Programming Language

Organizational Policy: Every large organization has their policy for maintaining themselves, so when an organization
considers buying software from another company or tech firm, they usually have a policy stating the type of language
they prefer. This policy is heavily influenced by the type of hardware and software the organization is currently using.
The organization may also have a policy like a guideline for setting the standard for the tool that is being developed,
this helps the organization in keeping the consistency of quality.

Suitability of Features and Tools: There are many options when choosing a programming language but a company
might need to select a language that is suitable for their system and works well with specific tools. There are many
languages, some with unique features that can meet the requirement. So, a company should consider analyzing
different languages before selecting one.

Availability of trained Staff: When considering the type of language an organization should keep in mind the
expertise of the employees for that particular language. This is will save a lot of time because the staff will be capable
of producing a fast solution. Some employees can be trained easily if the language is easy to learn but taking into
account the time and money for training. In other cases, the company might have to consider hiring a new specialist
for new projects.

Reliability: Every programming language comes with different features, when choosing a programing language, a
company should consider a few things in term of reliability. The language needs to be robust and easily maintainable
also how often will it crash. These are a few of the good questions to think about when considering a language in
terms of reliability.

Development and Maintenance Costs: Every organization's primary goal is to make a profit, when considering the
type of language few factors should always be checked, the maintenance cost and the cost of development. The cost
of development depends on the scarcity of the language, if it is a common programming language like C or Python it
should cost considerably less but for a rare language like Cobol, the development and maintenance cost may rise.

Expandability: Expandability is one of the most important factors for an organization. An organization should always
consider choosing a language that allows building a program that supports multiple users without causing any
technical issues. It is therefore critical to keep in mind the expandability of the solution.
Common Uses of Programming Languages

Websites

Websites use a combination of languages; this includes a compulsory markup language called HTML along with CSS
(cascading stylesheet) and for added features like web applications JavaScript is used.

Operating Systems

Three of the most popular operating systems in the market are; Linux, Mac, and windows. These three operating
systems use the same programming for building different systems. A kernel is a very crucial aspect of the Mac and
Linux operating system, and the kernel is built using C programming language, also windows use C programming
language throughout various stages in its programming.

Mobile Applications

Mobile phone applications are developed using either Java or Objective-C. IOs and Android is the most popular
mobile OS currently in the market. Apple uses Objective-C which is a very stable language and it is not used in any
other mobile application platform. Android on the other hand uses Java to program its applications.

Video Games

The most common programming language that game designer uses is C++, C, and Java. C++ is the most popular
among the three, because it is an object-oriented language that is very widely used, has a lot of community support
and a variety of tools is available for developers. Also, C++ is the most compatible language means it runs on most
devices.

Companies That Use Programming Languages

Facebook

Facebook is a social networking site that uses a combination of programming languages. This includes; Python,
JavaScript, HACK, C++, Java, PHP, D, Haskell, and few others. The Facebook back end is programmed using mainly C++
and JAVA is used for frontend and mobile application.

Google

Google uses various programming languages for their search engine as well as other applications. Primarily they use
Python, Java, JavaScript, C, and C++. C++ is used because it is one of the fastest languages and allows the
programmer to execute commands efficiently in the browser and other Google applications. Java is used for its
functionality and low maintenance features when compared to other languages such as C and C++. Python is also
used for its speed and efficiency.

Amazon
Amazon uses a programming language that is fast and efficient, they programming languages includes Perl, Java, and
C++. Although all three are languages that amazon uses but recently amazon is preferring C++ over java because of its
low maintenance requirement. The content delivery system of Amazon uses Perl as this language provides a reusable
module and also it can be used in combination with other languages.

Twitter

Initially, Twitter used Ruby on Rails as their go-to programming language for its simplicity, and also the language is
very adaptive, but later on Twitter decided to change its programming language for the back-end system to Scale,
which is an extension of Java. The reason behind it is because SCALE is less costly and has shorter latencies.
EXPLAIN SEQUENCE, SELECTION AND ITERATION AS
USED IN COMPUTER PROGRAMMING

Sequence

It is simple set of instruction that is used to build a program. This set of instruction is executed one after another in a
oderly fashion according to way it is written. Below is a diagram of sequence being executed in a code.

In the image above a program is instructed to execute a set of instruction, which includes printing 7 statements. Each
print statement have alphabet in a decending order from A to G. When we run the program, the sequence is runned
as well and the instruction is executed in accordance to the order that it was written in.

Iteration

It is simple structure that refers to the process of how a command is repeated until the condition is met, that is
defined in the particular program. Iteration has two tools for perfoming the repeatation process, which is also known
as loop. The two tools are:

 For loop
 While loop
In the above image we used a while loop for implementing iteration. The program contains a variable num and while
loop which has a condition. The condition states that as long the “num” variable is less than 9 it will print “num”, then
the program have print num and add +1 to it. This process is repeated until the num varible is greater than 9.

Selection

Selection which is also known as decision, allows the program to take two different routes.Depending the value of
the variable , a program may choose the route that satisfies the condition of the particular route.

In the image above a selection statement is used. In the statement two routes are presented, the selection of the
route depends on the value of variable. If the value of variable “num” is 1 than it will print the value of variable
doubled but if it is not 1 than it will print the value when it is multiplied by itself.
OUTLINE THE BENEFITS OF HAVING A VARIETY OF
DATA TYPES AVAILABLE TO THE PROGRAMMER

Advantages of having a variety of data types

Data types are used to define a data of its character, value and feature. It allows the computer to easily interpret the
value of the variable, and use the built in data type to define the data and also store the data accordingly. There are
numerous data types that are used in programming to represent data.Below is a table that contains most commonly
used data types in C#:

Data types Description Size (bytes) Range Example


Int Whole numbers 4 -2,147,483,648 1, 2 , 3 , 4, 556
to
2, 147, 483, 648

String Sequence of 2 per character N/A “Hello World”


Characters

Boolean Represents True or 1 True or False


false

Char Single character 2 N/A A,b,4,5

Decimal Fractional or Integral 29 significant digits


type with decimal
number

When making a program using different kinds of data type is beneficial for the user, as this will reduce usage of
memory when storing data.It also allows the user to easily manipulate the data by changing the value simply by
editing a line of code. It also helps in restricting users from giving the wrong type of input because data types can be
used to define the type of input that user should provide, in any case if the user input a wrong value the program will
not run, thus is very useful.
Data type also helps in making data more secure by providing specification limits when a variable is declared.

Choosing the right data type for a variable

 Importance of choosing the right data type

Selecting the right data type is crucial for programmer, because wrong data type can cause unexpected error
or even in most cases the program crashes. The right data type also save a lot of space , it also allow the
programmer to dictate if the variable defined should be global or local.

 Outcome in an event of wrong choice


Wrong data type can cause a program to crash , as wrong data types takesup too much space, sufficient
space will not be available for the program to run properly thus making the program crash.

You might also like