End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

CS 240 Computer Programming 1
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING TECHNIQUES
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
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
ALGORITHMS AND FLOWCHARTS
CS 240 Computer Programming 1
Fundamentals of Algorithms MCS - 2 Lecture # 4
Chapter 2- Visual Basic Schneider
Programming Fundamentals (750113) Ch1. Problem Solving
Developing logic (Examples on algorithm and flowchart)
Flow Charts. Thinking Creatively Flow Charts START END Is A==6? No A = 1 Yes Print A A = A + 1.
Review Algorithm Analysis Problem Solving Space Complexity
Flowchart Tutorial.
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
Original Source : and Problem and Problem Solving.ppt.
Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing.
ALGORITHMS AND FLOWCHARTS
CSC103: Introduction to Computer and Programming
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Algorithms In general algorithms is a name given to a defined set of steps used to complete a task. For example to make a cup of tea you would fill the.
Lesson Objectives 1. Practise writing sequence of instructions 2. Write flowcharts for different mechanisms Keywords: Input sensor Motion sensor Output.
Pseudocode Demo for Payroll.c
C++ If….Else Statements and Flowcharts October 10, 2007.
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.
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Software Life Cycle What Requirements Gathering, Problem definition
Algorithm & Flow Charts
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Chapter 2: General Problem Solving Concepts
1 Program Planning and Design Important stages before actual program is written.
Sequence Damian Gordon. Pseudocode When we write programs, we assume that the computer executes the program starting at the beginning and working its.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Introduction to Computing Dr. Nadeem A Khan. Lecture 2.
Structured Programming (4 Credits)
Structured Programming (4 Credits) HNDIT Week 2 – Learning Outcomes Design an algorithmic solution for simple problem such as computation of a factorial,
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.
1 Introduction to Flowcharting Computer Science Principles ASFA.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
 Problem Analysis  Coding  Debugging  Testing.
Algorithms and Flowcharts
GC101 Introduction to computers and programs
Lesson 2 Flowcharting.
Unit 3: ALGORITHMS AND FLOWCHARTS
Problem , Problem Solving, Algorithm & Flow Charts –Part 1
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Computer Programming Flowchart.
Numbering System TODAY AND TOMORROW 11th Edition
Introduction to Algorithm – part 1
Programming Logic n Techniques
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTS
Structured Program Design
ALGORITHMS AND FLOWCHARTS
Introduction to Algorithms and Programming
Flowcharts and Pseudo Code
Introduction to Programming
Flowcharts Activity One
Presentation transcript:

End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3. Writing a Computer Program 4. Testing the Computer program Different steps in solving a problem Solving a problem IT Department - National Institute of Education

End Show Lets take a problem and try to solve the problem Add two numbers and display total. Problem : IT Department - National Institute of Education

End Show How do you solve that problem ? The first task is to understand the problem clearly STEP 1 – Understand the problem Here the input should be two numbers. Find out the inputs ? IT Department - National Institute of Education

End Show That is Process. Find outputs ? Total. So there must be some calculation to get the total. IT Department - National Institute of Education

End Show STEP 2 – Developing an Algorithm for the problem The method that used to solve the problem is called algorithm Algorithm can be represented in two ways 1. Graphically 2. Textually IT Department - National Institute of Education

Boil water Add some sugar Put tea powder to mug Start Stop Serve A Graphical representation of making a cup of tea This Representation is called as Flow Chart IT Department - National Institute of Education End Show

A graphical representation of the sequence of operations in a program is called Flow Chart. Flowchart flowchart shows how data flows and operates IT Department - National Institute of Education

End Show Symbols used in Flow chart Start/Stop Input/Output Decision Flow line Process YesNo IT Department - National Institute of Education

Calculate total Start Stop A Graphical representation to add two numbers This Representation is called as Flow Chart Input two numbers Display total IT Department - National Institute of Education End Show

Draw a flow chart to find adult or child. Stop Input Age If age>=18 Adultchild Start YesNo IT Department - National Institute of Education

End Show Draw a flow chart to cross the road. Are clear both ways? Go to pavement No Cross the road Wait Yes Start Stop Look at left & right IT Department - National Institute of Education

End Show Draw a flow chart to find the correct key from a bunch keys to open the door. Can the door be opened Tryout a key No Try the next key Yes Start Stop IT Department - National Institute of Education

End Show Input name, Maths and Science marks and calculate Total. Display Name & Total Marks. Solve & design the above problem in Flow chart. Problem Solving 1 IT Department - National Institute of Education

Start Input Name, Maths Mks, Science Mks Total= Maths + Science Display Name,Total Stop Conti.. IT Department - National Institute of Education End Show

Problem Solving 2 Draw Flow chat to input Average Marks and display Pass or fail (If Average>= 60, “Pass” otherwise “Fail”) IT Department - National Institute of Education

End Show Start If Avg>=60 No PASS Display Grade FAIL Stop Yes Input Average IT Department - National Institute of Education

End Show “A” “B” “C” “S” “F” Draw a flow chart to input Average Marks and find the grade according to the grade System given below. Problem Solving 3 IT Department - National Institute of Education

End Show Input Avg If Avg>=75 If Avg>=65 If Avg>=55 If Avg>=45 Stop Start Display A Display B Display C Display S Yes No Display F IT Department - National Institute of Education

End Show Start Is Number < =10 No Print Number Stop Yes Number=1 Number=Number+1 Draw a flow chart to print numbers from1 to 10 IT Department - National Institute of Education

End Show One of the textual representation of algorithm is Pseudo code. Pseudo Code IT Department - National Institute of Education

End Show Begin Pseudo Code for adding two numbers End. Input first number and second number Total = first Number + Second Number output Total IT Department - National Institute of Education

End Show Begin Input Maths Marks,Science Marks Total = Maths + Science Average = Total / 2 If Average >= 60 then Grade= “PASS” Else Grade= “FAIL” End if Display Total, Average, Grade End Write a pseudo code to take maths and science marks, calculate total, average and display grade. (If average >=60, “Pass” otherwise “Fail”. IT Department - National Institute of Education

End Show “A” “B” “C” “S” “F” Write a pseudo code to input Average Marks and find the grade according to the grade System given below. IT Department - National Institute of Education

End Show Begin Input Avg Mks If Avg >=75 then Grade = “A” Else If Avg >=65 then Grade =“ B” Else If Avg >=55 then Grade = “C” Else If Avg >= 45 then Grade =“ S” Else Grade = “W” End if Display Grade End IT Department - National Institute of Education

End Show Begin Number=1 Do While Number <=10 Print Number Number=Number + 1 End while End Write a Pseudo code to display numbers from 1 to 10 IT Department - National Institute of Education