Algorithm & Flow Charts

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

ALGORITHMS AND FLOWCHARTS
Flow Chart.
Summer ’12 AP Computer Science APCS Summer Assignments Read thoroughly this ppt and solve examples 6 and 7.
CS 240 Computer Programming 1
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING TECHNIQUES
UNIT 2. Introduction to Computer Programming
ALGORITHMS AND FLOWCHARTS
Fundamentals of Algorithms MCS - 2 Lecture # 4
Flow Chart.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
ALGORITHMS Algorithm: Is an ordered set of unambiguous, executable steps defining a terminating process Unambiguous:during the execution of an algorithm,
Developing logic (Examples on algorithm and flowchart)
Review Algorithm Analysis Problem Solving Space Complexity
Algorithm & Flowchart.
Fundamentals of C programming
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Software Life Cycle What Requirements Gathering, Problem definition
A step-by-step procedure for solving a problem in a finite number of steps.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Basic Control Structures
Flowcharting & Algorithms. Quick. Close your Eyes and Listen You are still sitting in the classroom. However, you have been called to the counselor’s.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Introduction to Flowcharts
Program Program is a collection of instructions that will perform some task.
Let’s Play Tes Kelemotan Otak.
Algorithm & Flow Charts Decision Making and Looping
Lecture 2: Introduction to Programming EEE2108: 공학프로그래밍 서강대학교 전자공학과 2011 학년도 2 학기 - Algorithms and Flowcharts -
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Program design Program Design Process has 2 phases:
ALGORITHMS AND FLOWCHARTS
GC101 Introduction to computers and programs
Algorithm & Flow Charts Week 1
Problem Solving Concepts
Unit 3: ALGORITHMS AND FLOWCHARTS
Problem , Problem Solving, Algorithm & Flow Charts –Part 1
Be A programmer in Steps
ALGORITHMS AND FLOWCHARTS
FLOWCHARTS.
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Computer Programming Flowchart.
Algorithms and Flowcharts
Programming Fundamentals
ALGORITHMS AND FLOWCHARTS
Lecture 2: Logical Problems with Choices
Unit# 9: Computer Program Development
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING CSC 111.
ALGORITHMS AND FLOWCHARTS
Introduction to Algorithms and Programming
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
ME 142 Engineering Computation I
Introduction to Programming
Presentation transcript:

Algorithm & Flow Charts Presented By Manesh T Course:1090 CS

ALGORITHMS AND FLOWCHARTS Step by step method to solve a problem is algorithm Flow Chart Diagrammatic representation of algorithm

Algorithm Example 1: Write an algorithm to Add two numbers

Problem: Add two numbers Step 1: Start Step 2: Read A, B Step 3: C=A+B Step 4: Print C Step 5: Stop

Algorithm Problem: Subtract 2 numbers Problem: Multiply 2 numbers Step 1: Start Step 2: Read A, B Step 3: C=A*B Step 4: Print C Step 5: Stop Step 1: Start Step 2: Read A, B Step 3: C=A-B Step 4: Print C Step 5: Stop

Algorithm Problem: Average of 3 numbers Step 1: Start Step 2: Read A, B, C Step 3: Avg=(A+B+C)/3 Step 4: Print Avg Step 5: Stop

Algorithm Problem: Find your Age Step 1: Start Step 2: Read Byear Step 3: Age=2015-Byear Step 4: Print Age Step 5: Stop

Algorithm Problem: Area of Circle Step 1: Start Step 2: Read Radius Step 3: Area=3.14*Radius *Radius Step 4: Print Area Step 5: Stop

Algorithm Problem: Find even or odd Step 1: Start Step 2: Read N Step 3: Is (N%2=0) then Print “Even” else Print “Odd” Step 4: Stop

Algorithm Problem: Find Pass or Fail Detailed Algorithm Step 1: Start Step 2: Read M1,M2,M3,M4 Step 3: GRADE  M1+M2+M3+M4 Step 4: Is (GRADE < 60) then Print “FAIL” else Print “PASS” Step 5: Stop

The Flowchart A Flowchart is another algorithm but graphical. shows logic solution emphasizes individual steps and their interconnections A flowchart must have a start and stop A steps in a flowchart must connect.

Flowchart Symbols General Used Symbols

Flow Chart: Add Two Numbers Algorithm Start Flowchart Read A, B C=A+B Print C Stop

DECISION STRUCTURES The expression A>B is a logical expression it describes a condition we want to test if A>B is true (if A is greater than B) we take the action on left print the value of A if A>B is false (if A is not greater than B) we take the action on right print the value of B

DECISION STRUCTURES is A>B Y N Print A Print B

Flow Chart: Find Even or Odd Start Read N Is N%2=0 Y N Print “Odd” Print “Even” Stop

Flow Chart: Find Largest of two numbers Start Read A, B Is A>B Y N Print “B is large” Print “A is large” Stop

Problem: Write Algorithm and Flowchart to find solution of Quadratic equation START Read a, b, c d  sqrt(b x b – 4 x a x c) STOP x1 (–b + d) / (2 x a) X2  (–b – d) / (2 x a) Algorithm: Step 1: Start Step 2: Read a, b, c Step 3: d  sqrt ( ) Step 4: x1  (–b + d) / (2 x a) Step 5: x2  (–b – d) / (2 x a) Step 6: Print x1, x2 Step 7: Stop Print X1, X2

Assignment 1 Draw algorithm and flowchart Find area of triangle (area=(1/2)*breadth*height) Convert Celsius to Fahrenheit temperature f = (1.8*c) + 32; Volume of cylinder(V= 3.14*R*R*Height) Find volume of sphere (4/3* 3.14*R*R*R) Find biggest of three numbers.

Instructions to students Study definition well Study different algorithms well Study how to draw flowchart for specific problems. Workout various assignment problems Approach me for any doubt clarifications

Control Statements Decision Making & Branching Decision Making & Looping If Statement Switch ConditionalStatement For loop While loop Do while loop Jump Break Continue Simple If If else Nested if else If else ladder