Introduction to Computing Lecture 00: Part 3 Introduction to Algorithms and Flowcharts (continued) Introduction to Computing Lecture 00: Part 3 Introduction.

Slides:



Advertisements
Similar presentations
CS 240 Computer Programming 1
Advertisements

Introduction to Programming
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Creating Flowcharts Principles Of Engineering
UNIT 2. Introduction to Computer Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Flowchart What is a flowchart? A flowchart is a schematic representation of an algorithm or a process or a program. Why should a flowchart be produce before.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
CS 240 Computer Programming 1
Java Planning our Programs Flowcharts Arithmetic Operators.
Computer Science 101 Overview of Algorithms. Example: Make Pancakes Prepare batter Beat 2 eggs Add 1 tablespoon of brown sugar Add 1 cup of milk Add 2.
Chapter 2- Visual Basic Schneider
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
Flowcharts Remember that a solution to a problem is called an algorithm. Algorithms are often a series of steps required to solve the problem. A flowchart.
Algorithm Design CS105. Problem Solving Algorithm: set of unambiguous instructions to solve a problem – Breaking down a problem into a set of sub- problems.
Developing logic (Examples on algorithm and flowchart)
BBS Yapısal Programlama (Structured Programming)1 From problem to program In “real world”… Problem in Natural language Top Down Design in pseudo-code.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
Chapter 1 Pseudocode & Flowcharts
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Introduction to Computing Lecture 07: Repetition and Loop Statements (Part II) Introduction to Computing Lecture 07: Repetition and Loop Statements (Part.
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.
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.
CSEB114: Principle of programming
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
King Saud University College of applied studies and community services CSC 1101 Computer Programming I Lecture 2.
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Software Life Cycle What Requirements Gathering, Problem definition
Flowcharts.
Fried chicken with green beans and zucchini Students: SOFRONEA ANA-MARIA NETEDU ALEXANDRA.
Chapter 2: General Problem Solving Concepts
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.
TURKISH RAVIOLI. MATERIALS (5 persons) FOR THE DOUGH: 3-4 cups flour 4 eggs 1 cup water Salt MORTAR FOR: 2 onions 400 g ground meat (taken twice) Salt,
Slide 1 Controlling Sequences of Events Traffic lights Event table.
Introduction to Computing Dr. Nadeem A Khan. Lecture 2.
PAELLA FAIR TRADE RICE. INGREDIENTS 2 cloves garlic 2 cups rice 400g good quality pork Chorizo 1 green pepper 1 red pepper 2 handfuls peas 6 cups meat/vegetable.
The Hashemite University Computer Engineering Department
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Our regional specialities. Proportions for 6 persons: For the marinade : 2 liters of good red wine (côte du rhone or Cahors for example) 2 peeled, cut.
Philippines CURRIED BEEF FILIPINO STYLE 1 1/2 lb. cubed cut beef 2 med. chopped onions 2 crushed garlic cloves 2 chopped celery stalks 1 finely chopped.
Creating Flowcharts Principles of Engineering
Creating a Flowchart Computer Integrated Manufacturing
Computer Science Department
Turkish traditional food [mantı]
GC101 Introduction to computers and programs
Lesson 2 Flowcharting.
IGCSE 1 Cambridge Algorithms and flowcharts Unit 7 Computer Science
Chapter One Problem Solving
Chapter 2- Visual Basic Schneider
Introduction to Computing
Computer Programming Flowchart.
Introduction To Flowcharting
Creating Flowcharts Principles of Engineering
Repetition and Loop Statements
Creating Flowcharts Principles of Engineering
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
Introduction to Programming
Creating Flowcharts Principles of Engineering
Creating Flowcharts Principles Of Engineering
Presentation transcript:

Introduction to Computing Lecture 00: Part 3 Introduction to Algorithms and Flowcharts (continued) Introduction to Computing Lecture 00: Part 3 Introduction to Algorithms and Flowcharts (continued) Assist.Prof.Dr. Nükhet ÖZBEK Ege University Department of Electrical&Electronics Engineering

Expressing Algorithms Natural Languages Natural Languages Pseudocode Pseudocode Flowcharts Flowcharts Programming Languages Programming Languages

Natural Language Algorithm Cilbir 6 eggs 6 eggs ½ kg yogurt ½ kg yogurt 3 large garlic cloves 3 large garlic cloves 4 Tbs fresh butter 4 Tbs fresh butter 1 tsp red pepper, coarsely ground 1 tsp red pepper, coarsely ground 2 middle-sized onions cut horizontally 2 middle-sized onions cut horizontally plenty water plenty water Boil water in a fairly big pot. Break one by one the eggs and pour them in a plate, being careful not to break the yolk. To ensure a homogenous cooking, let them “glide” from the plate into the boiling water. Within three minutes the eggs are ready but if you prefer hard-boiled, allow them to cook for another minute or so. Boil water in a fairly big pot. Break one by one the eggs and pour them in a plate, being careful not to break the yolk. To ensure a homogenous cooking, let them “glide” from the plate into the boiling water. Within three minutes the eggs are ready but if you prefer hard-boiled, allow them to cook for another minute or so. Meanwhile brown the butter in a skillet and add the garlic and onion. In the last possible moment add the coarsely ground red pepper and turn off the fire. Remove the eggs from the pot using a skimmer and place them in a deep plate. Meanwhile brown the butter in a skillet and add the garlic and onion. In the last possible moment add the coarsely ground red pepper and turn off the fire. Remove the eggs from the pot using a skimmer and place them in a deep plate. Cover the eggs with plenty of yogurt and pour the hot butter over them. Serve immediately. Cover the eggs with plenty of yogurt and pour the hot butter over them. Serve immediately. From

Pseudocode Algorithm Example Set moveCount to 1 FOR each row on the board FOR each column on the board FOR each column on the board IF gameBoard position (row, column) is occupied THEN IF gameBoard position (row, column) is occupied THEN CALL findAdjacentTiles with row, column CALL findAdjacentTiles with row, column INCREMENT moveCount INCREMENT moveCount END IF END IF END FOR END FOR END FOR

Algorithm Example Set number counter to zero Set sum to zero While (number counter < 10) { input a number Sum = Sum + Number increment number counter by 1 } Calculate average = sum / 10

Labwork 1 Write an algorithm to calculate the area of circle Write an algorithm to calculate the area of circle

Labwork 1 Input radius Set pi = 3.14 Calculate area = pi * radius * radius

Labwork 2 Write an algorithm to calculate the sum of multiples of 3 up to 100 Write an algorithm to calculate the sum of multiples of 3 up to 100

Labwork 2 Set number counter to zero Set sum to zero While (number counter < 100) { Sum = Sum + Number counter increment number counter by 3 }

Flowcharts Flowcharts are schematic representations of processes Flowcharts are schematic representations of processes Generally the start point, end points, inputs, outputs, possible paths and the decisions that lead to these possible paths are included Generally the start point, end points, inputs, outputs, possible paths and the decisions that lead to these possible paths are included Flow-charts can be created by hand or manually in most office software, but lately specialized diagram drawing software has emerged that can also be used for the purpose Flow-charts can be created by hand or manually in most office software, but lately specialized diagram drawing software has emerged that can also be used for the purpose

Flowchart Symbols (Mostly Used) Start / End symbol Start / End symbol Arrows Arrows Processing steps Processing steps Input/Output Input/Output Conditional (Decision) Conditional (Decision)

Flowchart Symbols (Others) Document Document Magnetic Tape Magnetic Tape Display Display Manual Input Manual Input

Flowchart Example From wikipedia.org

Flowchart Example From smartdraw.com

Flowchart Example Read NAME, BALANCE, RATE Compute INTEREST as BALANCE x RATE Write (Display) NAME and INTEREST

Flowchart Example From wikipedia.org

Flowchart Example START Input N Sum =0 C = 0 Input number Sum = Sum + number C = C + 1 C = N? A = Sum / N END No Yes Print A

Labwork 3 Draw a flowchart to find the sum of first 50 counting numbers Draw a flowchart to find the sum of first 50 counting numbers

Labwork 3

Labwork 4 Draw a flowchart to find the largest of three numbers A,B, and C. Draw a flowchart to find the largest of three numbers A,B, and C.

Labwork 5 Draw a flowchart to find the product of two numbers using only addition operation Draw a flowchart to find the product of two numbers using only addition operation

Labwork 5

Labwork 6 Draw a flowchart to find the division of two integer numbers using only subtraction operation. Find the division and remainder. Draw a flowchart to find the division of two integer numbers using only subtraction operation. Find the division and remainder.

Labwork 6

Summary Problem Solving Process Problem Solving Process Algorithms Algorithms Components of Algorithms Components of Algorithms Flowcharts Flowcharts