Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

PSEUDOCODE & FLOW CHART
ALGORITHMS AND FLOWCHARTS
ECE Application Programming
Section 9-9: The Quadratic Formula & The Discriminant Pg.652.
Chapter 2- Visual Basic Schneider
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 4 Programming and Software EXCEL and MathCAD.
An Overview of Programming Logic and Design
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 3 Programming and Software.
Developing logic (Examples on algorithm and flowchart)
1.2 – Open Sentences and Graphs
Algorithm & Flowchart Credit: Mr Ainullotfi.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
Algorithm & Flowchart.
Fundamentals of C programming
4.8: Quadratic Formula HW: worksheet
DCT 1123 Problem Solving & Algorithms
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Muhammad Adnan Talib Lec#4 27 th Sep,2012 Computer Science Department COMSATS Institute of Information Technology Sahiwal Introduction to Computer Programming.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Algorithms and Flowcharts for Programming CFD
Software Life Cycle What Requirements Gathering, Problem definition
Mathematics for Computing Lecture 1: Numerical Representation Dr Andrew Purkiss-Trew Cancer Research UK
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
5.6 Quadratic Formula & Discriminant
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
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.
1 Program Planning and Design Important stages before actual program is written.
5.6 Quadratic Formula & Discriminant By: L. Keali’i Alicea.
More about Quadratic Equations November 16, 2009.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Introducing block scheme programming March 17. Algorithm / Flow chart An algorithm or a flowchart is a step-by-step procedure for solving a particular.
Quadratic Functions (4) What is the discriminant What is the discriminant Using the discriminant Using the discriminant.
Getting Started The objective is to be able to solve any quadratic equation by using the quadratic formula. Quadratic Equation - An equation in x that.
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Introduction to Flowcharts
Program Program is a collection of instructions that will perform some 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.
 Problem Analysis  Coding  Debugging  Testing.
Algorithm & Flowchart.
Program design Program Design Process has 2 phases:
GC101 Introduction to computers and programs
ECE Application Programming
CS111 Computer Programming
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Introduction to Computer Programming
Programming Logic n Techniques
Programming Fundamentals
ALGORITHMS AND FLOWCHARTS
Visual Basic 6 Programming.
Introduction to Algorithms
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
Algorithms & Pseudocode & Flowcharts
Introduction to Algorithms and Programming
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
` Structured Programming & Flowchart
ME 142 Engineering Computation I
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Basic Concepts of Algorithm
Algorithms & Pseudocode & Flowcharts
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK

Algorithms An algorithm is a step-by-step set of instructions for solving a particular problem We will be using flowcharts to explore simple algorithms

Flowchart Graphical representation of an algorithm Show the ‘layout’ of a program Form is a series of symbols linked with arrows

Flowchart symbols 1 Terminator Data Entry (or Input/Output) Process

Flowchart Symbols 2 Decision Preparation Connector 1

Flowchart example 1 Find the mean of two numbers Start Read X,Y Sum = X+Y Mean = Sum / 2 Print Mean Stop

Flowchart example 2:1 Solve a quadratic equation ax 2 +bx+c = 0 Discriminant, D = b 2 -4ac, tells us how many real solutions. D <0 means no real solution, D=1 means 1 solution: x = -b/2a D>0 means 2 solns: x = -b ± √(b 2 – 4ac) 2a

Flowchart example 2:2 Start Read A,B,C D = B 2 -4xAxC Sign of D? 123 negative positive zero 123 Print ‘No real solution X = -B 2xA Print ‘solution’, X Stop X1 = -B + √D 2xA X2 = -B - √D 2xA Print X1, X2

Pseudocode Algorithms can also be represented as ‘English language’ instructions. These are then converted to the relevant program code.

Variables and Constants Variable Constants Numerical: Integer or exponential Non-numerical: Strings Logical: True or False

Flowchart Symbols Input / Output Process Decision Connector Preparation Terminal