Principles, Characteristics, and Features of Procedural Programming

Verified

Added on  2020/01/28

|6
|1648
|317
Homework Assignment
AI Summary
This assignment delves into the core concepts of procedural programming, a fundamental approach to computer programming where instructions are executed in a specific order. The solution explores the principles of procedural programming, emphasizing its structured and modular nature, the use of functions, and the top-down approach. It then examines the characteristics, including the importance given to actions, the use of global data, and the transfer of data between functions. Furthermore, the assignment highlights the features of procedural programming, particularly using the C language, including its portability, modularity, flexibility, and speed, as well as the use of pre-defined functions, local variables, parameter passing, and selection and loop structures. The solution also covers the reasons for choosing C, such as its portability and efficiency, and includes a discussion of control structures like if-else and switch statements, as well as loop structures such as for, while, and do-while loops.
Document Page
Procedural writing computer programs is the most normal method for guiding a PC as the PC
processors claim dialect and machine code is procedural. It is likewise alluded as organized or
measured programming. Procedural writing computer programs is performed by guiding the PC
and how to do it through a rundown of well ordered guidelines. In this manner, procedural
programming includes strategies, which infers that there are steps that should be taken after to
finish a particular errand. For instance read a number, include 7 or show a particular message.
Procedural writing computer programs is very direct and productive as more than frequently in
the first place, the program is composed in a typical and plain dialect by applying rationale
before really composing the code.
The fundamental elements of procedural writing computer programs is that it is moderately
simple to peruse and compose program code and keep up program code as various methods can
be repaired independently. Moreover, vast projects are isolated into littler ones and that the
greater part of the information is shared and can thusly be come to from some other point inside
the program.
Convincingly, considering that the fundamental qualities of procedural programing being
consecutive rationale, effortlessness, simple usage of compilers and mediators, capacity to make
utilization of a similar code in the program by calling it as opposed to duplicating, ease with
which the program stream can be followed, capacity to be unequivocally particular or organized,
it can be said that procedural writing computer programs is a basic venturing stone towards
adapting further programming abilities.
Discuss the principles, characteristics and features of procedural
programming
Programming language is the computer language in which the program are written so that they
communicate with the computer to perform the required task. Programs are the instructions that
are written to control the behavior of the machine. Program can be written in 2 forms:
Low level programming language
High level programming language
Low level Programming language: In this program is written in the machine language. In this
no compiler is needed to convert the program into machine language. That’s why it run very
quickly.
High level Programming language: It is very close to the human. It is understandable. In this
compiler or interpreter is needed that covert the high level instruction to the low level
instructions.
C is the procedural programming language that is it makes the use of the procedure to make the
program execute. Program is made up of procedure or function to provide the required
functionality.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Characteristics of Procedural Programming:
It gives more importance to the things to be done.
Functions are basically used to provide the functionality.
Global data is used for sharing.
Data is transferred from one form to another between the functions.
Top down approach is used
This design is inappropriate for the large program.
2. Reasons of choice C(min 6 reasons..)
Ans C is the high level programming language. It is used popular due to several reasons:
Portability: it is independent of platform. It means it can be used on different platform without
making the change in the code.
Modularity: As C is based on the procedural programming so the large functionality can be
broken down into several modules that causes the program compilation and debugging execution
faster.
Flexibility: C provides the flexibility feature as it help the programmer to take control over the
program modification and its usage.
Speed: As C supports the system programming that causes the program to compile faster in
comparison to the high level programming language.
Extensibility: C support the extensibility feature. At any time new feature can be added into it.
Compactness: C also provides the handful reserve words to increase the functionality of
program. Due to the precision use of the keywords, C support this feature.
Principles(Min 8 option) ?
It is of small size.
It supports the extensive use of functions/procedures.
It supports the loose typing –unlike PASCAL.
Relatively easy to read and write the program code and the maintenance and debugging
also.
The code executes in the sequential manner and the ability to make use of the same code
in the program by calling it.
Document Page
It is efficient and the most natural way of telling a computer what to do as the computer
processors own language and machine code is procedural.
It is the structured language
Low level programming readily available.
Characteristics(Min 8 option) ?
C language is well suited for structured modular programming
C is a robust language with rich set of built-in functions and operators
The C compiler comes with the combined feature of assembly language and the level
language.
It is more faster than BASIC
It also supports the extensibility feature.
It is also used in designing the operating system and the embedded system.
It also supports the portability feature that the same program can be used or run on
another machine.
Program written in C are efficient and faster.
Features (Min 200 word) ?
C is a powerful, flexible language that provides fast program execution and imposes few
constraints on the programmer. It allows low level access to information and commands
while still keeping the portability and syntax of a high level language. These qualities make it
a useful language for both systems programming and general purpose programs.
C's power and fast program execution come from it's ability to access low level commands,
similar to assembly language, but with high level syntax. It's flexibility comes from the many
ways the programmer has to accomplish the same tasks. C includes bitwise operators along
with powerful pointer manipulation capabilities. C imposes few constraints on the
programmer. The main area this shows up is in C's lack of type checking. This can be a
powerful advantage to an experienced programmer but a dangerous disadvantage to a novice.
Another strong point of C is it's use of modularity. Sections of code can be stored in libraries
for re-use in future programs. This concept of modularity also helps with C's portability and
execution speed. The core C language leaves out many features included in the core of other
languages. These functions are instead stored in the C Standard Library where they can be
called on when needed.. An example of this concept would be C's lack of built in I/O
capabilities. I/O functions tend to slow down program execution and also be machine
independent when running optimally. For these reasons, they are stored in a library
separately from the C language and only included when necessary.
Key features of Procedural Programming
Document Page
Pre-defined functions: C provides the inbuilt libraries or inbuilt functions that enables
to perform the complex functionality without writing the multiple steps. It saves the
programmer’s effort and the time.
Local Variables: Their scope is limited to the block in which it is declared
For example {
// outer block
{// inner block
Int a =2;}}
A variable scope is restricted to the inner block only.
Parameter Passing: Parameter can be passed to the function using 2 methods:
Call by reference
Call by value
Modularity: C supports the modularity feature as the large program can be divided into
several small modules.
Procedures: C makes the use of the procedure to provide the functionality.
Programming libraries: C also provides the inbuilt libraries to enhance the
functionality. Programmer can make use of it to write the complex logic.
Procedural programming paradigm: C follows the top down approach that is much
importance is given to flow of program rather than on data on which functions operate.
Selection structures (if-else, switch-case)
C also supports the selection structures. It makes the use of the if else block or switch block.
If-Else : In this statement is executed on the basis of the condition. If statement can be followed
by the optional else block. If the condition written inside evaluates to true then if block otherwise
else block.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Switch:
A switch statement allows a variable to be tested for equality against a list of values. Each value
is called a case, and the variable being switched on is checked for each switch case.
or-loop in C?
C also supports the loop structure which allow the block of statements multiple times.
This can be provided using the following:
For loop : Executes a sequence of statements multiple times and abbreviates the code
that manages the loop variable.
Syntax:
While loop : repeats a statement or group of statements while a given condition is true. It
tests the condition before executing the loop body.
Syntax:
Do while loop: It is more like a while statement, except that it tests the condition at the
end of the loop body.
Syntax:
Document Page
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon