Introducing block scheme programming March 17. Algorithm / Flow chart An algorithm or a flowchart is a step-by-step procedure for solving a particular.

Slides:



Advertisements
Similar presentations
Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
Advertisements

EE2372 Software Design with Flowcharts
1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
1 Flowchart. 2 Flowchart: It is a diagram consists of symbolic block that represents the algorithm step by step Symbols of flowchart: 1. Terminal (start,
Introduction to Flowcharting
Creating Flowcharts Principles Of Engineering
UNIT 2. Introduction to Computer Programming
Introduction to Flowcharting
ALGORITHMS & FLOWCHARTING II
ME 142 Engineering Computation I Fundamentals of Procedural Computer Programming.
ALGORITHMS AND FLOWCHARTS
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
solution If a quadratic equation is in the form ax 2 + c = 0, no bx term, then it is easier to solve the equation by finding the square roots. Solve.
Algorithm and Flowchart Questions
The Program Development Cycle and Program Design Tools
CHAPTER 4: ALGORITHM 4.1 Introduction stages identified in the program development process: 1. Problem analysis and specification 2. Data organization.
Review Algorithm Analysis Problem Solving Space Complexity
Fundamentals of C programming
6.5 – Solving Equations with Quadratic Techniques.
Algorithms and Flowcharts for Programming CFD
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
The Quadratic Formula. What does the Quadratic Formula Do ? The Quadratic formula allows you to find the roots of a quadratic equation (if they exist)
Software Life Cycle What Requirements Gathering, Problem definition
A step-by-step procedure for solving a problem in a finite number of steps.
Quadratics Solving equations Using “Completing the Square”
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Basic problem solving CSC 111.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
5.3 – Solving Quadratic Equations by Factoring. Ex. 1 Solve y = x 2 + 5x + 6 by factoring.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Introducing programming March 24. Program structure Statements to establish the start of the program Variable declaration Program statements (block statements)
Introduction to compilation process March 24. The following slides will show you step by step instruction how to get ready and build C language programs.
Structured Programming (4 Credits)
1 Introduction to Flowcharting Computer Science Principles ASFA.
FLOWCHARTING AND ALGORITHMS
Introduction to Flowcharts
Program Program is a collection of instructions that will perform some task.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
 Problem Analysis  Coding  Debugging  Testing.
Program design Program Design Process has 2 phases:
ALGORITHMS AND FLOWCHARTS
Lesson 2 Flowcharting.
7.3 Solving Equations Using Quadratic Techniques
Unit 3: ALGORITHMS AND FLOWCHARTS
The Quadratic Formula..
Algorithm & Programming
Quadratic Formula Solving for X Solving for quadratic equations.
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Algorithms and Flowcharts
Sum and Product of Roots
Introduction to Computer Programming
Programming Logic n Techniques
ALGORITHMS AND FLOWCHARTS
1) C program development 2) Selection structure
ME 142 Engineering Computation I
Flowchart.
The Quadratic Formula..
Electrical and Computer Engineering Department SUNY – New Paltz
Computational physics: intro workshop
The Quadratic Formula..
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
quadratic formula. If ax2 + bx + c = 0 then
Presentation transcript:

Introducing block scheme programming March 17

Algorithm / Flow chart An algorithm or a flowchart is a step-by-step procedure for solving a particular problem, independently of the programming language. 2 A general plan for solving problems consist of Write the specification of the problem to be solved i.e. inputs, outputs Draw flowchart or write algorithm Convert flowchart (algorithm) into program code Compile the program into object code Execute the program

Flow chart basic symbols 3 Computations Input / Output Decision Start / stop Connector Flow of control

Adding the numbers 4 start read A, B, C S = A + B + C output S stop

Larger of two numbers 5 start read X, Y output X stop X > Y ? output Y stop yes no

Larger of three numbers 6 start read X, Y, Z stop X > Y ? stop yesno max > Z ? Output max Output z yesno Max = XMax = Y

7 start read N stop Count > N ? output sum no yes sum = sum + count * count sum = 0 count = 1 count = count + 1 Sum = … + N 2

8 start read N stop Count > N ? output sum no yes sum = sum + count * (count + 1) sum = 0 count = 1 count = count + 1 sum = 1 * * * 4 + … + N * (N +1)

9 start read N stop count > N ? output sum no yes prod = prod * count prod = 1 count = 1 count = count + 1 Computing factorial

10 start Read X, N stop count > N ? output sum no yes sum = prod * count term = term * X / count term = 1 prod = 1 count = 1 count = count + 1 Computing e x series up to N terms Use Taylor expansion to represent e x up to N terms.

11 start Read X, N stop term <.0001 ? output sum no yes sum = prod * count term = term * X / count term = 1 prod = 1 count = 1 count = count + 1 Computing e x series up to 4 decimal places Use Taylor expansion to represent e x up to 4 decimal places.

Do you it yourself Draw a block scheme for the algorithm that finds roots of quadratic equations ax 2 + bx + c = 0 12

Homework Draw a flowchart for the following algorithms 1.Find whether a number is prime or not. 2.Find sin(x), using the following series Hint: see problem on slides 10 and …