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

PROG 211-Lesson 3-Algorithm

This document discusses writing algorithms in programming. It defines an algorithm as a step-by-step procedure to solve problems. The document outlines 6 steps to write an algorithm: 1) determine the outcome, 2) decide a starting point, 3) find the ending point, 4) list steps from start to finish, 5) determine how to accomplish each step, and 6) review the algorithm. It then provides two examples of algorithms - one to convert feet to centimeters and another to calculate the area of a rectangle.

Uploaded by

Mariquina Erwin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
280 views

PROG 211-Lesson 3-Algorithm

This document discusses writing algorithms in programming. It defines an algorithm as a step-by-step procedure to solve problems. The document outlines 6 steps to write an algorithm: 1) determine the outcome, 2) decide a starting point, 3) find the ending point, 4) list steps from start to finish, 5) determine how to accomplish each step, and 6) review the algorithm. It then provides two examples of algorithms - one to convert feet to centimeters and another to calculate the area of a rectangle.

Uploaded by

Mariquina Erwin
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Lesson 3: Coding Using

Standard Algorithm:
Algorithms
HELLO!
Engr. Erwin Mariquina
You can find me at

2
Pre-test
Multiple choice: Choose the letter of the correct answer that referred to the
statements below on the steps in writing an algorithm.

1. To determine the outcome of your code, one must know?


A. What is the specific problem you want to solve or the task you want it to
accomplish?
B. What facts will we learn from the processes?
C. What formulas are applicable to the issue at hand?
D. What will be added or no longer exists?

3
Pre-test
Multiple choice: Choose the letter of the correct answer that referred to the
statements below on the steps in writing an algorithm.

2. Finding your starting and ending point are crucial to listing the steps of the
process. To determine a starting point, determine the answer to these
questions, except?
A. What data/inputs are available?
B. Where is that data collected?
C. What facts will we learn from the process?
D. What formulas are applicable to the issue at hand?

4
Pre-test
Multiple choice: Choose the letter of the correct answer that referred to the
statements below on the steps in writing an algorithm.

3. As with the starting point, you can find the end point of your algorithm by
focusing on these questions, except?
A. What facts will we learn from the process?
B. What changes from the start to the end?
C. What will be added or no longer exist?
D. How do data values relate to each other?

5
Pre-test
Multiple choice: Choose the letter of the correct answer that referred to the
statements below on the steps in writing an algorithm.

4. To use a real-world example, let’s say your goal is to have lasagna for
dinner. You’ve determined that the starting point is to find a recipe, and
that the end results is that you’ll have lasagna fully cooked and ready to eat
by 7pm. What will you do?
A. Determine how will you accomplish each step.
B. List the steps from start to finish.
C. Find the ending point of the algorithm.
D. Determine the outcome of your code.

6
Pre-test
Multiple choice: Choose the letter of the correct answer that referred to the
statements below on the steps in writing an algorithm.

5. Now that you’ve written your algorithm, its time evaluate the process by?
A. Review the algorithm.
B. List the steps from start to finish.
C. Find the ending point of the algorithm.
D. Determine how will you accomplish each step.

7
Expectations
At the end of the lesson, the students should be able to:
1. Understand algorithm; and
2. Code using standard algorithm.

8
Technical Terms:
Algorithm – the step by step procedure in solving a problem
End point – the final stage of a period or process.
Outcome – the way a thing turns out; a consequence.
Starting point – a place or position where something begins;
a place or position where something begins.

9
Technical Terms:
Algorithm – the step by step procedure in solving a problem
End point – the final stage of a period or process.
Outcome – the way a thing turns out; a consequence.
Starting point – a place or position where something begins;
a place or position where something begins.

10
What is an algorithm?
Generally, an algorithm is a step-by-step procedure to solve
Problems. A guide for installing new software, a manual for
assembling appliance, and even recipes are examples are
examples of algorithm. In programming, making an algorithm
is exciting, they are expressed in a programming language or in
a pseudo code.

11
continuation…….
Algorithm makes the whole procedure more efficient as well
as consistent. It is also helps in identifying decision points,
processes, and essential variables to solve the problem. A
programmer can also see and determine easily the error in a
particular process using an algorithm.

12
Steps in Writing an Algorithm in
Programming
1. Determine the outcome of your code.
2. Decide a starting point.
3. Finding the ending point of the algorithm.
4. List the steps from start to finish.
5. Determine how you will accomplish each step.
6. Review your algorithm.

13
Algorithm Examples
Example 1: Write an algorithm to convert the length in feet to
centimeter.

Step 1: Input Lft


Step 2: Lcm=Lft x 30
Step 3: print Lcm

14
Algorithm Examples
Example 2: Write an algorithm that will read the two sides of a
rectangle and calculate its area.

Step 1: Input W, L
Step 2: A = L x W
Step 3: print A

15
THANKS!
Any questions?
You can find me at:
@username
[email protected]

16

You might also like