0% found this document useful (0 votes)
2 views15 pages

Lesson-3-PRINCIPLES-OF-PROGRAMMING-LANGUAGES-Copy (1)

The document discusses the principles of programming languages, focusing on algorithms, pseudocode, and flowcharts. It defines algorithms as step-by-step procedures for problem-solving, provides examples in both algorithm and pseudocode formats, and explains flowcharts as graphical representations of algorithms. Additionally, it outlines flowchart symbols and guidelines for creating effective flowcharts.

Uploaded by

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

Lesson-3-PRINCIPLES-OF-PROGRAMMING-LANGUAGES-Copy (1)

The document discusses the principles of programming languages, focusing on algorithms, pseudocode, and flowcharts. It defines algorithms as step-by-step procedures for problem-solving, provides examples in both algorithm and pseudocode formats, and explains flowcharts as graphical representations of algorithms. Additionally, it outlines flowchart symbols and guidelines for creating effective flowcharts.

Uploaded by

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

PRINCIPLES OF

PROGRAMMING
LANGUAGES
PREPARED BY: DYCYN T. ALVARO
ALGORITHM,
PSEUDOCODE,
&
FLOWCHART
Algorithm
A step-by-step procedure to solve a given problem.
It can be defined as a set of well-defined instructions or rules
designed to solve a specific problem.
It can be used to solve a wide variety of problems, including
mathematical problems, logical problems, and computational
problems.
Algorithms are often written in natural language, but they can also
be written in pseudocode or a programming language, providing a
precise and logical sequence of operations.
Algorithm Example
 Algorithm to add two numbers entered by the user.

Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum using the formula (sum = num1 +
num2)
Step 5: Display sum
Step 6: Stop
Pseudocode
A compact and informal high-level description of a program.
It is a non-executable language that uses natural language
mixed with programming constructs.
It is written in the form of annotations and informational text
that is written in plain English only. Just like programming
languages, it doesn't have any syntax, so it cannot be compiled
or interpreted by the compiler.
Pseudocode Example
Pseudocode to add two numbers entered by the user.

Begin
Initialize num1, num2, sum.
Read num1, num2.
Compute sum as sum = num1 + num2
Write sum
End
Flowchart
A type of diagram that represents an algorithm or process.
It is a graphical representation of an algorithm. It uses different shapes
to represent the different steps in the algorithm. The shapes are
connected by arrows to show the flow of data through the algorithm.
Flowcharts are a helpful way to visualize the flow of data through a
program. They can be used to understand complex algorithms and for
debugging programs. It allows programmers and non-programmers
alike to understand the solution's structure and logic briefly.
Flowchart Symbols
Flowchart Symbols
Flowchart Example
Flowchart to add two numbers entered by the user.
Flowchart Example
Flowchart to determine if the number is Positive or Negative Number
Flowchart Example
Flowchart to determine if the number is Positive or Negative Integer
Flowchart Example
Flowchart to determine if the number is Positive or Negative Integer
Flowchart Example
Flowchart to determine if the number is Positive or Negative Integer
Flowchart Guidelines
•Flowchart starts with a Terminal Symbol
•Flowchart can have only one start and one stop symbol
•On-page connectors are referenced using numbers
•Off-page connectors are referenced using alphabets
•General flow of processes is top to bottom or left to right
•Symbols of flowchart must be connected with arrow
•Arrows should not cross each other

You might also like