KEMBAR78
Algorithm (Basic Algorithm Presentation).pptx
TOPIC
ALGORITHM
Computational Thinking
 Computational thinking means thinking or solving problems like a computer
scientist.
 There are four key techniques to computational thinking:
 Decomposition
 Pattern Recognition
 Abstraction
 Algorithm
Computational Thinking
 Pattern recognition:
 Looking for similarities among and within problems.
 Abstraction:
 Focusing on the important information only, ignoring irrelevant detail.
Decomposition
 The process of breaking down a complex problem into smaller, simple and
easy to manage parts.
 We do many tasks on a daily without even thinking about or decomposing
them, such as getting ready to school, finishing school work
 Breaking the problem down into smaller parts means that each smaller
problem can be examined in more detail.
What is Algorithm?
 An algorithm is a process or set of rules to be followed in calculations or other
problem-solving operations, especially by a computer.
 It is a set of rules to obtain the expected output from the given input.

 An algorithm is simply a set of steps used to complete a specific task
Algorithm Around Us
 Algorithms are everywhere around us.
 We humans follow and perform daily tasks in the form of algorithms without
knowing that they are algorithms.
 One of the most obvious examples of an algorithm is a recipe. It’s a finite list of
instructions used to perform a task.
 Example: making tea, cross the road
Algorithm in Computer Science
 Algorithm are one of the four cornerstones of computational thinking.
 Algorithmic programming is all about writing a set of rules with a finite number
of steps that instruct the computer how to perform a task.
 A computer program is essentially an algorithm that tells the computer what
specific steps to execute, in what specific order, in order to carry out a
specific task.
Algorithm in Computer Science
 An algorithm are written using a particular syntax, depending on the
programming language being used.
Algorithm in Computer Science
 Find the product of two numbers.
 Find the number 1.
 Find the number 2.
 What is operator?
 Where to store the result?
Algorithm in Computer Science
 Find the product of two numbers.
 Enter number 1
 Store number 1 in x
 Enter number 2
 Store number 2 in y
 Multiple x & y
 Store result in z (z=x*y)
 Display number
Note: now these instructions can be easily translated into computer program
What is Computer Program?
 In computer program, a sequence of instructions is given to computer to solve a
specific problem.
 Computer programs consist of a series of instructions to tell a computer exactly what to
do and how to do it.
 Programing:
 Programing is writing computer code to create a program, in order to solve a
problem.
 Code:
 Code is the process of translating an algorithm into a programming language.
Algorithm in Computer Science
 Solve: 8+9*7+2(9-3)
 Write a computer program that ensures that everyone who is under 15 years
of age will get discount.
Algorithm
 Algorithm:
 Find out how old the person is
 If the person is younger than 15 then say “You are eligible for a discount
ticket”
 Otherwise, say “you are not eligible for a discount ticket”
Program
 Program in syntax based language:
age = int(input(“How old are you”))
If age < 15:
print(“You are eligible for discount”)
else:
print(“you are not eligible for discount”)
Write a program that can find the sum of three numbers and
print the results
Write a program that can find the sum of three numbers and
print the results
‫!شکریہ‬
‫کا۔۔۔‬ ‫توجہ‬ ‫کی‬ ‫آپ‬

Algorithm (Basic Algorithm Presentation).pptx

  • 2.
  • 3.
    Computational Thinking  Computationalthinking means thinking or solving problems like a computer scientist.  There are four key techniques to computational thinking:  Decomposition  Pattern Recognition  Abstraction  Algorithm
  • 4.
    Computational Thinking  Patternrecognition:  Looking for similarities among and within problems.  Abstraction:  Focusing on the important information only, ignoring irrelevant detail.
  • 5.
    Decomposition  The processof breaking down a complex problem into smaller, simple and easy to manage parts.  We do many tasks on a daily without even thinking about or decomposing them, such as getting ready to school, finishing school work  Breaking the problem down into smaller parts means that each smaller problem can be examined in more detail.
  • 6.
    What is Algorithm? An algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.  It is a set of rules to obtain the expected output from the given input.   An algorithm is simply a set of steps used to complete a specific task
  • 7.
    Algorithm Around Us Algorithms are everywhere around us.  We humans follow and perform daily tasks in the form of algorithms without knowing that they are algorithms.  One of the most obvious examples of an algorithm is a recipe. It’s a finite list of instructions used to perform a task.  Example: making tea, cross the road
  • 8.
    Algorithm in ComputerScience  Algorithm are one of the four cornerstones of computational thinking.  Algorithmic programming is all about writing a set of rules with a finite number of steps that instruct the computer how to perform a task.  A computer program is essentially an algorithm that tells the computer what specific steps to execute, in what specific order, in order to carry out a specific task.
  • 9.
    Algorithm in ComputerScience  An algorithm are written using a particular syntax, depending on the programming language being used.
  • 10.
    Algorithm in ComputerScience  Find the product of two numbers.  Find the number 1.  Find the number 2.  What is operator?  Where to store the result?
  • 11.
    Algorithm in ComputerScience  Find the product of two numbers.  Enter number 1  Store number 1 in x  Enter number 2  Store number 2 in y  Multiple x & y  Store result in z (z=x*y)  Display number Note: now these instructions can be easily translated into computer program
  • 12.
    What is ComputerProgram?  In computer program, a sequence of instructions is given to computer to solve a specific problem.  Computer programs consist of a series of instructions to tell a computer exactly what to do and how to do it.  Programing:  Programing is writing computer code to create a program, in order to solve a problem.  Code:  Code is the process of translating an algorithm into a programming language.
  • 13.
    Algorithm in ComputerScience  Solve: 8+9*7+2(9-3)  Write a computer program that ensures that everyone who is under 15 years of age will get discount.
  • 14.
    Algorithm  Algorithm:  Findout how old the person is  If the person is younger than 15 then say “You are eligible for a discount ticket”  Otherwise, say “you are not eligible for a discount ticket”
  • 15.
    Program  Program insyntax based language: age = int(input(“How old are you”)) If age < 15: print(“You are eligible for discount”) else: print(“you are not eligible for discount”)
  • 16.
    Write a programthat can find the sum of three numbers and print the results
  • 17.
    Write a programthat can find the sum of three numbers and print the results
  • 18.