The document discusses algorithms and flowcharts, defining algorithms as step-by-step procedures for problem-solving and flowcharts as visual representations of these processes. It outlines the characteristics of a good algorithm, such as unambiguity and effectiveness, and provides examples of simple algorithms for computing averages and evaluating expressions. Additionally, it describes basic flowchart symbols used in diagramming processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
9 views3 pages
Ict Again
The document discusses algorithms and flowcharts, defining algorithms as step-by-step procedures for problem-solving and flowcharts as visual representations of these processes. It outlines the characteristics of a good algorithm, such as unambiguity and effectiveness, and provides examples of simple algorithms for computing averages and evaluating expressions. Additionally, it describes basic flowchart symbols used in diagramming processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
UC2 WEEK 4
Topic: ALGORITHM AND FLOWCHART
Algorithm: Step-by-step procedure to solve a problem or perform an operation. Example: Cooking fried rice. Flowchart: Visual representation of steps and decisions to solve a problem, using diagram shapes and arrows. Functions of an Algorithm: 1. Road maps for tasks. 2. Develop effective solutions. 3. Predict special cases. 4. Manage memory and data. 5. Simplify program development. CHARACTERISTICS OF AN ALGORITHM The characteristics of a good algorithm are: Unambiguous: Each step must be clear, well-defined and precise. It must be easy to understand the procedure. Effectiveness: it must give the correct answer. Finiteness – there is exact number of steps to be taken and has an end. Precision – the steps are precisely stated (defined). Uniqueness – results of each step are uniquely defined and only depend on the input and the result of the preceding steps. Sequence of execution: instructions are performed from top to bottom. Input specified: must specify the type, amount and from of data to be used during the algorithm. Output: It should result in at least one output.
WRITING SIMPLE ALGORITHMS FOR SOLVING PROBLEMS
1. Algorithm to compute the average of a given set of numbers. The Algorithm follows: i. c = 1 (use to count the numbers processed) ii. Sum = 0 iii. If c > sum: go to line viii iv. Sum = sum + c v. c=c+1 vi. Go to line iii vii. vii average = sum/c viii. Print the average ix. End.
2. An algorithm that evaluates Y=a(b-c) /d + 2
2 i. Input the values a, b, c, d ii. Y=a*(b-c)^2 /(d + 2) iii. Print Y
3. An algorithm that prints out the first ten odd numbers.
i. Count =0 ii. Sum=1 iii. Sum =sum + count iv. If count > 10, go to line viii v. Count = count + 2 vi. Go to line iii vii. Average = sum/num viii. Print average ix. End
BASIC FLOWCHART SYMBOLS
The flowchart symbols are as follows: Terminator (Start and Stop): The oval, or terminator, is used to represent the start and end of a process.
Process: It represents any step in the process you’re
diagramming
Data (Input/Output): Input and output symbols show where and
how data is coming in and out throughout your process Arrow (Directional flow): The arrow is used to guide the viewer along their flowcharting path.
Decision (Diamond): The diamond symbolizes that
a decision is required to move forward.
Document: Single and multiple document icons show that there
are additional points of reference involved in your flowchart.
Connector: connector symbols make it easier to connect
flowcharts that span multiple pages.
Predefined process: Used to reference flowchart defined
elsewhere. FLOWCHART DIAGRAMS FOR GIVEN PROBLEMS 1. Flowchart to compute the average of a given set of numbers.
Video Links: https://youtu.be/jwG5gaD3rU4