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

L2a - Algorithms

The document outlines the phases of problem solving in software development, including analysis, requirements, design, coding, testing, and maintenance. It defines an algorithm as a precise and unambiguous set of instructions to solve a problem within a finite time. Additionally, it explains the relationship between algorithms, coding, and programming languages, emphasizing the importance of understanding customer requirements and desired outcomes.

Uploaded by

tanqueray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

L2a - Algorithms

The document outlines the phases of problem solving in software development, including analysis, requirements, design, coding, testing, and maintenance. It defines an algorithm as a precise and unambiguous set of instructions to solve a problem within a finite time. Additionally, it explains the relationship between algorithms, coding, and programming languages, emphasizing the importance of understanding customer requirements and desired outcomes.

Uploaded by

tanqueray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem solving: algorithms

1
Phases in problem solving

Problem
Solution

Time

2
Software life cycle

Problem Specify what the program should exactly do in all possible


Analysis cases.

Requirements

Design Specify a procedure (algorithm) to solve the problem


according to the requirements analyzed

Algorithm
Translate the algorithm into the chosen programming
Coding language. Includes program coding and fixing compilation
bugs.
Program

Testing Check that the program works properly in all possible


cases. Correction of execution errors (debugging).

Maintenance Correct errors not detected in the testing phase. Make the
appropriate modifications if the requirements change.
3
Problem solving: Concept of Algorithm

Objective: Solve a
problem

Definition of Algorithm:
Accurate and unambiguous description of the
Analysis actions to be taken to solve a well-defined
problem in a finite time.

Design Accurate: The order of each step must be


indicated.
Unambiguous: There is only one interpretation.
Well-defined: it always gets the same result.
Algorithm* Finite time: It ends in a finite number of steps.

* It derives from the Latin translation of the word Alkhôwarîzmi, an Arab mathematician who
4
wrote an essay on the manipulation of numbers and equations in the 9th century
Algorithms and Programs

Objective: Solve a
Definition of Coding:
problem
Writing the algorithm using a programming
language.

Algorithm Definition of Programming language:


A set of precise instructions that can be
interpreted and executed by a computer.
Coding
Programming
language Definition of Compiler:
Program that translates the source code into
machine language.
Program
Definition of Program:
Coding of the algorithm by using a specific
programming language.
5
Analysis of the Problem

Analysis: Understand WHAT the customer wants


Clear definition of what the program should do
Problem and the desired outcome.

At the highest level of abstraction, the


computational solution would be as follows:

Data Program Information

Input Processing Output

We have to answer:
- What is the desired output? (type and quantity)
- What method produces the output?
- What input is needed? (type and quantity)
6
Analysis of the Problem: Example

We want to make a
program that reads,
via keyboard, the
person's birth year and
calculates the person's - What is the desired output? (type and quantity)
age. Then the program - Person’s age
must tell us if the
person is of legal age - Message informing if the person is of legal age
or not. - What method produces the output?
- Calculating age as the difference between the birth
year and the current year
- Comparison between age and age of majority (18
years)
- What input is needed? (type and quantity)
- Birth Year

You might also like