0% found this document useful (0 votes)
216 views

Class 1+2

The document defines algorithms and outlines the process of programming an application. It provides definitions of algorithms as step-by-step descriptions to solve problems. It gives an example algorithm of displaying the sum of two numbers using a flowchart. It also outlines the key stages in compiling a computer program, including editing, preprocessing, interpreting/compiling, assembling, linking, and loading. Finally, it discusses outlining the process and designing an application, including planning, designing, and developing stages.

Uploaded by

Abdullah Rock
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views

Class 1+2

The document defines algorithms and outlines the process of programming an application. It provides definitions of algorithms as step-by-step descriptions to solve problems. It gives an example algorithm of displaying the sum of two numbers using a flowchart. It also outlines the key stages in compiling a computer program, including editing, preprocessing, interpreting/compiling, assembling, linking, and loading. Finally, it discusses outlining the process and designing an application, including planning, designing, and developing stages.

Uploaded by

Abdullah Rock
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

LO1: Define basic algorithms to carry out an operation and outline the process of

programming an application

Definition of Algorithm
- An algorithm is a step-by-step description to solve a problem.
- An algorithm is a step by step method of solving a problem. It is commonly used for data
processing, calculation and other related computer and mathematical operations.
- An algorithm is also used to manipulate data in various ways, such as inserting a new data
item, searching for a particular item or sorting an item.

2. Example of an algorithm
What is an Algorithm?
A set of rules is a series of instructions that we follow step by step to help us solve a
problem. A simple way to remember a set of rules is using a recipe; we use this example to
put together the cake and wish to follow a certain set of commands to solve our problem.
Algorithms are used by all automated devices to carry out functions. They work by
accepting input and executing all of the commands/steps in the set of rules to get an
output.
In computer programming, algorithms are often formed as functions. These functions serve
as small programs that can be referenced by a larger program. In many cases, there are
several ways to perform a specific operation within a software program. In general term, an
algorithm is defined as a set of instructions designed to perform a specific task. Algorithms
work via input and output. They take the input and apply each step of the algorithm to that
information to produce an output.
Characteristics of a good algorithm are,
 Input and output should be defined accurately.
 Each step in the algorithm should be clear and unmistakable.
 Algorithms should be most effective among many different ways to solve a problem.
 An algorithm shouldn't contain computer code. Instead, the algorithm should be
written in such a way that it can be used in different programming languages.

Benefits of algorithm:
Algorithm is a step-wise representation of salutation of problem, which make us familiar
with the problem and decreases its complexity. It makes the task easier to decide on a
specific step. It is easier to start the program with the help of algorithm and also increases
the flexibility of program. Algorithm development process allows and even delivers a
rational study of the solution.

Limitations of algorithm:
Algorithm is not a program, but the concept of what the software should be. Lengthy
development process is time expending and difficult to write. It is difficult to identify each
process and program information.
B. Features
1. An algorithm must be:
+ Definite
+ Finite
+ Precise and Effective
+ Implementation Independent
2. Explain the above four characteristics:
+ Definite:
Before solving a problem, we must know what is the problem about? What we need
to solve it? How many steps we need to do to solve it? Algorithms are created to
solve the complication. We write algorithms to do things we need it to do.
+ Finite:
An algorithms we wrote must be limited, one algorithms solve one problem, many
algorithms solve many progress.
+ Precise and Effective:
An algorithm must work effectively and optimally. When we write algorithms, we will
have to spend a lot of time, I am not mention about when we write wrong code and
have to try again. It must be clear and unambiguous. Each steps should be clear and
its input and output must lead to only one meaning.
+ Implementation Independent:
An algorithm should have step-by-step directions which is should be independent of
any programming code.

Flowchart
Flowchart is the graphical representation of an algorithm. It can be considered as an
implementation of algorithm. A flowchart gives a clear idea about the framework of the
program. Every single step in a flowchart is contained within a shape. These shapes are the
symbols used in a flowchart. The symbols used in flowchart are:
Symbol Name Function
Process Indicates any type of
internal operation inside of
the processor.
Input/output Used for any input/output
(I/O) operation.
Decision Used to ask a question that
can be answered in a binary
format.
Connector Allows the flowchart to be
drawn without intersecting
lines or without a reverse
flow.
Predefined process Used to invoke a subroutine
or an interrupt program.
Terminal Indicates the start or ending
of program, process or
interrupt program.
Flow lines Indicates the direction of
flow of program.

Example of flowchart:
Flowchart to display sum of two numbers.
Compiling process of a computer program/Processes taken from
writing code to execution

Program written in C, C++ or C# goes through multi-stage process. As an overview, those


multi stage processes can be divided into 5 different steps: Editor, Preprocessor,
Interpreter, Assembler, Linker and finally Loader, which are explained in depth below:
1. Editor:
The first stage of program compiling is Editor where a programmer creates a source file
using text editor which contains a program written in high level language. In this context,
we are writing a program in java using eclipse IDE. “Eclipse and netbeans is an Integrated
Development Environment (IDE) that enables us to write code much more efficiently.
eclipse has built in Application Programming Interface (API) which helps in auto completion
to increase speed and accuracy of our program.”

Fig: Visual Studio Editor.


2. Preprocessor:
The second stage is called Preprocessor where it deals with macro-processing,
augmentation, file inclusion, language extension of the program present in the source code.
Generally, a preprocessor is considered as a part of compiler which produces input for the
program execution.
3. Interpreter & Compiler:
This is the third stage of compiling a program. Here interpreter or compiler translates high-
level language into machine language. The difference is that an interpreter executes the
whole program step by step and if any errors found it stops execution and reports the
error.
In case of compiler: even if there is an error, the whole program is executed and compiled
at once, providing error after the compilation process.
4. Assembler:
In this stage, an assembler translates the assembly language (low level language) into
machine understandable form. The output generated by an assembler contains a sequence
of instruction in machine understandable form along with information for storing in the
computer’s memory. This generated output is also called Object file.
5. Linker:
This is the fifth stage of compiling a program where Linker links and merges the object file
obtained from assembler together to form an executable file. The main task of a linker is to
verify and locate oriented module in a program and also provide the location of it in the
system memory where the codes will be loaded so that the program instruction are
provided with absolute orientations.
6. Loader:
The final stage is where a Loader, which is part of an OS, is responsible for processing
executable files into the system memory and execute them in order. The size of instruction
and data fed to a program is calculated and creates a certain memory space to store them.

Outlining Process and Designing Application


A software is designed with a certain number of process/steps. An outlining process and
designing application are the same process required in efficiently transforming a user’s
needs into an effective software or application. It includes the activities needed for building
the software, integrating the methods and practices to be embraced. It also includes the
activities essential for planning the project, tracing its progress and managing the
complications while developing a software. The outline process or the steps of designing a
software application are as follows:
1. Planning:
This phase in the application development cycle is also called concept phase. Concept
phase is that period where the user needs are described and formulated through
documentation like statements of necessity, advance planning report, feasibility studies on
operational and technical areas. Proper planning is done so that no problems arises in the
future with minimizing the risks.
2. Designing:
Preliminary design of a software is created when all the requirement of the user is
understood or met. This design covers the general structure of the software, major
components, and internal data streams. Here after the preliminary design the developer
designs a detailed design for the application with all the risk analysis, functional and non-
functional specifications.
3. Developing:
This is the phase where the coding for the software or application is done. Here basically
design is converted into code. There are different parts in the development phase that are
independent of the specific details that are to be coded i.e. preferred programming
language can be chosen for the ease of coding. Besides this, the developing phase may
produce alterations to the design documentation and unit tests to house the errors that
have been detected.
4. Testing:
The most important part of the software development is the testing phase. Testing is
conducted to detect and remove the errors. In most of the cases testing requires much
more effort than coding. Plans for these shouldn’t merely comprise removal of bugs or
errors in the software, but also the conventional responses of the software. Testing should
be carried out by those individuals who are responsible for designing and coding as well as
the representatives of the client. This process may repeat until the desired output is
obtained.
5. Deployment/Maintenance:
After the completion of testing phase and no errors are found in the system then the final
process i.e. deployment and maintenance start. The software is delivered to the client and
installed in the client’s hardware and some amount of end user training is provided. With
time as the client becomes expert and the client adapts to the software, the level of
support and effort involved decreases from the developers. However, some problem may
arise in the future which may need some modifications, the maintenance phase revisits all
the other stages of the software life cycle. Modification may be required to eliminate
errors, to provide additional functionality or the product to be used in a completely new
environment.
Depending on the size, nature and complexity of the project, some activities might not be
present or in many projects the activities could be performed in an informal manner. For
example: small projects might not have a very detailed Requirements Definition Document
(RDD) or System Analysis Document (SAD).

You might also like