Algorithms: A Primer for Computer Studies

undefined
 
Introduction to
Algorithm – part 1
 
Senior 5 – Computer Studies
 
Ms Jennifer
What is an Algorithm?
 
 
A
n
 
A
l
g
o
r
i
t
h
m
 
i
s
 
a
 
s
t
e
p
 
b
y
 
s
t
e
p
p
r
o
c
e
s
s
 
t
o
 
s
o
l
v
e
 
a
 
c
o
m
p
u
t
i
n
g
p
r
o
b
l
e
m
.
 
Start
Step 1
Step 2
Step 3
Step 4
Step…
End
 
Process
Ms Jennifer
What is a process?
 
A process is a series of steps
(instructions) to achieve a
particular goal
Ms Jennifer
 
How can we express a an
algorithm?
 
1.
Think of a solution to
the problem
2.
Think of the steps
required to achieve
the final solution.
3.
Write down the
STEPS.
Ms Jennifer
 
What is Pseudo code?
 
Pseudo code means 
’false code’
 and
it is essentially a summary of the
algorithm written in steps using a
language and specific terms. There
are no set rules in using pseudo as
long as all the steps of the
algorithm are written sequentially
and are logically correct.
Ms Jennifer
 
What is Pseudo code?
 
Specific terms used in pseudo code include:
 
Arithmetic operations
Transfer operations
Input / output operations
Decision operations
Repetition operations
 
Ms Jennifer
Example question
 
How do you log in to Facebook?
Answer? Use a laptop, tablet, computer,
smart phone, etc.
How do you write an algorithm to log in to
Facebook?
1
st
 step: Go to 
www.facebook.com
2
nd
 step: Enter email and password
3
rd
 step: Click on ‘Login in’ button.
Ms Jennifer
 
An algorithm is constructed
with Pseudo Code and
Flowcharts
 
Pseudo Code
 
Flowcharts
 
Step by step
instructions
similar to
computer code.
 
Graphical
representation of
the sequence of
steps of an
algorithm.
 
Ms Jennifer
Pseudo code for Arithmetic
calculations
Sum
 = 
A
 + 
B
Print
 
Sum
How many subjects there is in 
Sum
?
 
Sum
 = 
A
B
Print
 
Sum
How many subjects there is in 
Sum
?
 
Person A
 has  
6 subjects
Person B
 has  
3 subjects
Ms Jennifer
Pseudo code for Arithmetic
calculations (input and output)
Give input 
value
 to 
A
Save
 
A
Give input 
value
 to 
B
Save
 
B
Sum
 = 
A
 x 
B
Print
 
Sum
 
What is the 
value
 of 
Sum
?
 
A
 = 
0
; 
B
 = 
0
;
Ms Jennifer
 
Flow Chart of Arithmetic
calculation (input and output)
 
 
Ms Jennifer
undefined
 
Tasks
 
Conclusion Algorithm Topic first part
 
Ms Jennifer
 
Conclusion
 
An algorithm is a step by step process to
solve a computing problem.
A process is a series of steps or instructions
to achieve a particular goal.
An algorithm can be developed through
pseudo code and flowcharts.
Pseudo code defines the algorithm in a series
of sequential steps/ instructions
Flowcharts express the steps of an algorithm
in a graphical representation. Each shape
means a particular stage or step of an
algorithm.
 
Ms Jennifer
undefined
 
Introduction to
Algorithm – part 2
 
Senior 5 – Computer Studies
 
Ms Jennifer
 
An algorithm is constructed
with Pseudo Code and
Flowcharts
 
Pseudo Code
 
Flowcharts
 
Step by step
instructions
similar to
computer code.
 
Graphical
representation of
the sequence of
steps of an
algorithm.
 
Ms Jennifer
 
Concept Flowchart
 
Ms Jennifer
 
Flow Chart of Arithmetic
calculation (input and output)
 
 
Ms Jennifer
 
Mixer Flowchart – Decisions /
Repetitions
 
Ms Jennifer
undefined
 
Task 1
 
Pseudo code of kitchen mixer
 
Ms Jennifer
 
Task 2 – Flowchart to log in to
Facebook
 
Pseudo Code:
 
1
st
 step: Go to 
www.facebook.com
2
nd
 step: Enter email and password
3
rd
 step: Click on ‘Login in’ button.
 
Ms Jennifer
 
Steps to make art coffee.
 
1. Put coffee with
boiling water in the
cup
 
2. Add steamed milk
to the top of cup
Ms Jennifer
Steps to make art coffee.
 
3. 
Make circular
designs with
chocolate sauce.
 
4. 
Draw inward and
outward lines with a
toothpick.
Ms Jennifer
Steps to make art coffee.
 
End result – Web coffee art!
Ms Jennifer
undefined
 
Pseudo Code If […] Then
[….] Else [….] statements
 
Conditional statements
 
Ms Jennifer
Pseudo Code for coffee art.
Start Program
Step 1
. 
If
 cup has coffee
Then
 -> Add milk
Else
 Add coffee
Step 2
. 
If
 cup has coffee + milk
Then 
-> Add chocolate sauce in circular motion
Else
 go to 
step 1
Step 3
. 
If
 cup has chocolate sauce on top
Then 
-> make horizontal lines with toothpick
Else
 go to 
step 2
Step 4
. 
End
 
If
 Coffee has horizontal chocolate
lines..
Else
 go to 
step 3
End program
 
 
N
o
t
e
:
 
t
h
e
 
c
o
n
d
i
t
i
o
n
a
l
s
t
a
t
e
m
e
n
t
s
 
i
n
 
r
e
d
Ms Jennifer
undefined
 
Task 3
 
Develop flowchart
 
Ms Jennifer
 
Conclusion
 
An algorithm is a step by step process to
solve a computing problem.
In computing an algorithm is expressed
by pseudo code and flowcharts.
Pseudo code consists of a sequence of
steps to solve a computing problem.
Flowcharts are used to show the sequence
of steps in a graphical representation
using different shapes to present
terminals, processes, decisions and inputs
and outputs.
 
Ms Jennifer
Slide Note

Jennifer Elmer

Embed
Share

Delve into the world of algorithms with Ms. Jennifer as your guide in this educational series. Learn the nuances of processes, pseudo-code, and problem-solving steps through structured lessons. Grasp the essence of expressions, flowcharts, and the language of algorithms, ensuring a solid foundation in algorithmic thinking.

  • Algorithms
  • Computer Studies
  • Problem-solving
  • Education
  • Algorithmic Thinking

Uploaded on Nov 19, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Introduction to Algorithm part 1 Senior 5 Computer Studies Ms Jennifer

  2. An Algorithm is a step by step process to solve a computing problem. Start Step 1 Step 2 Step 3 Step 4 Step End Process What is an Algorithm? Ms Jennifer

  3. A process is a series of steps (instructions) to achieve a particular goal What is a process? Ms Jennifer

  4. 1. Think of a solution to the problem 2. Think of the steps required to achieve the final solution. 3. Write down the STEPS. How can we express a an algorithm? Ms Jennifer

  5. Pseudo code means false code and it is essentially a summary of the algorithm written in steps using a language and specific terms. There are no set rules in using pseudo as long as all the steps of the algorithm are written sequentially and are logically correct. What is Pseudo code? Ms Jennifer

  6. Specific terms used in pseudo code include: Arithmetic operations Transfer operations Input / output operations Decision operations Repetition operations What is Pseudo code? Ms Jennifer

  7. How do you log in to Facebook? Answer? Use a laptop, tablet, computer, smart phone, etc. How do you write an algorithm to log in to Facebook? 1st step: Go to www.facebook.com 2nd step: Enter email and password 3rdstep: Click on Login in button. Example question Ms Jennifer

  8. Pseudo Code Flowcharts Graphical representation of the sequence of steps of an algorithm. Step by step instructions similar to computer code. An algorithm is constructed with Pseudo Code and Flowcharts Ms Jennifer

  9. Person A has 6 subjects Person B has 3 subjects Sum = A + B Print Sum How many subjects there is in Sum? Sum = A B Print Sum How many subjects there is in Sum? Pseudo code for Arithmetic calculations Ms Jennifer

  10. A = 0; B = 0; Give input value to A Save A Give input value to B Save B Sum = A x B Print Sum What is the value of Sum? Pseudo code for Arithmetic calculations (input and output) Ms Jennifer

  11. Flow Chart of Arithmetic calculation (input and output) Ms Jennifer

  12. Tasks Conclusion Algorithm Topic first part Ms Jennifer

  13. An algorithm is a step by step process to solve a computing problem. A process is a series of steps or instructions to achieve a particular goal. An algorithm can be developed through pseudo code and flowcharts. Pseudo code defines the algorithm in a series of sequential steps/ instructions Flowcharts express the steps of an algorithm in a graphical representation. Each shape means a particular stage or step of an algorithm. Conclusion Ms Jennifer

  14. Introduction to Algorithm part 2 Senior 5 Computer Studies Ms Jennifer

  15. Pseudo Code Flowcharts Graphical representation of the sequence of steps of an algorithm. Step by step instructions similar to computer code. An algorithm is constructed with Pseudo Code and Flowcharts Ms Jennifer

  16. Concept Flowchart Ms Jennifer

  17. Flow Chart of Arithmetic calculation (input and output) Ms Jennifer

  18. Mixer Flowchart Decisions / Repetitions Ms Jennifer

  19. Task 1 Pseudo code of kitchen mixer Ms Jennifer

  20. Pseudo Code: 1st step: Go to www.facebook.com 2nd step: Enter email and password 3rdstep: Click on Login in button. Task 2 Flowchart to log in to Facebook Ms Jennifer

  21. 1. Put coffee with boiling water in the cup 2. Add steamed milk to the top of cup Steps to make art coffee. Ms Jennifer

  22. 4. Draw inward and outward lines with a toothpick. 3. Make circular designs with chocolate sauce. Steps to make art coffee. Ms Jennifer

  23. End result Web coffee art! Steps to make art coffee. Ms Jennifer

  24. Pseudo Code If [] Then [ .] Else [ .] statements Conditional statements Ms Jennifer

  25. Start Program Step 1. If cup has coffee Then -> Add milk Else Add coffee Step 2. If cup has coffee + milk Then -> Add chocolate sauce in circular motion Else go to step 1 Step 3. If cup has chocolate sauce on top Then -> make horizontal lines with toothpick Else go to step 2 Step 4. End If Coffee has horizontal chocolate lines.. Else go to step 3 End program Note: the conditional statements in red Pseudo Code for coffee art. Ms Jennifer

  26. Task 3 Develop flowchart Ms Jennifer

  27. An algorithm is a step by step process to solve a computing problem. In computing an algorithm is expressed by pseudo code and flowcharts. Pseudo code consists of a sequence of steps to solve a computing problem. Flowcharts are used to show the sequence of steps in a graphical representation using different shapes to present terminals, processes, decisions and inputs and outputs. Conclusion Ms Jennifer

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#