Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

ALGORITHMS AND FLOWCHARTS
Summer ’12 AP Computer Science APCS Summer Assignments Read thoroughly this ppt and solve examples 6 and 7.
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING TECHNIQUES
ALGORITHMS AND FLOWCHARTS
Fundamentals of Algorithms MCS - 2 Lecture # 4
INTRODUCTION TO PROGRAMMING
Developing logic (Examples on algorithm and flowchart)
Chapter 3 Planning Your Solution
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.
Fundamentals of C programming
ALGORITHMS AND FLOWCHARTS
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
U NDERSTANDING P ROBLEMS AND HOW TO S OLVE THEM BY USING C OMPUTERS.
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Software Life Cycle What Requirements Gathering, Problem definition
Algorithm & Flow Charts
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
Flowcharts.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
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.
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-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
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. 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.
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.
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
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
Computer Programming.
Algorithm & Programming
Be A programmer in Steps
ALGORITHMS AND FLOWCHARTS
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Computer Programming Flowchart.
Algorithms and Flowcharts
Lecture 2 Introduction to Programming
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.
Programming Fundamentals
ALGORITHMS AND FLOWCHARTS
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
Understanding Problems and how to Solve them by using Computers
Introduction to Programming
Basic Concepts of Algorithm
Presentation transcript:

Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1

Objectives of the Session Defining Problem Defining Problem Solving Need for Problem Solving Problem Solving Strategy Define-Algorithms- Rules of Algorithms Examples of Algorithms Define-Flowcharts-Rules of Flowchart Examples of Flowcharts Model Exercises Take Away Tutorials 101CS Manesh T2

Problem and Problem Solving Definitions The state of feeling difficulty in completing any task is called problem The process of working through details of a problem to reach a solution. Problem solving may include mathematical or systematic operations and can be a gauge of an individual's critical thinking skills. 101CS Manesh T3

Need for Problem Solving A computer is a tool that can be used to implement a plan for solving a problem. A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan. An algorithm is a plan for solving a problem. A person must design an algorithm. A person must translate an algorithm into a computer program. 101CS Manesh T4

ALGORITHMS AND FLOWCHARTS Algorithm  Step by step method to solve a problem is algorithm Flow Chart  Diagrammatic representation of algorithm 101CS Manesh T5

Divide and conquer strategy A divide and conquer algorithm works by recursively breaking down a problem into two or more sub- problems of the same (or related) type, until solved 101CS Manesh T6

7

Steps in development of Algorithms 1. Define Problem 2. Adopt Problem solving Method 3. Specify of Algorithm 4. Design an Algorithm 5. Check correctness of Algorithm 6. Analysis of Algorithm 7. Implementation of Algorithm 8. Test Algorithm 9. Documentation Preparation 101CS Manesh T8

Qualities of a good algorithm Inputs and outputs should be defined precisely. Each steps in algorithm should be clear and unambiguous. Algorithm should be most effective among many different ways to solve a problem. An algorithm shouldn't have computer code. Instead, the algorithm should be written in such a way that, it can be used in similar programming languages. 101CS Manesh T9

Algorithm Problem: How to brush your teeth Real life Example Step 1: Start Step 2: Wake up Step 3: Wash mouth Step 4: Wash brush, apply toothpaste Step 5: Brush your teeth Step 6. Wash mouth and brush Step 7: Put brush back to holder Step 8: Stop 101CS Manesh T10

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

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

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 101CS Manesh T13

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

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 101CS Manesh T15

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 101CS Manesh T16

Algorithm Problem: Find +ve or -ve Step 1: Start Step 2: Read Number Step 3: Is (N>0) then Print “+ve number” else Print “-ve Number” Step 4: Stop 101CS Manesh T17

Detailed Algorithm Step 1: Start Step 2: Read Mark Step 3: Is (Mark>=60) then Print “PASS” else Print “Fail” Step 4: Stop Algorithm Problem: Find Pass or Fail 101CS Manesh T18

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. 101CS Manesh T19

Flowchart Symbols General Used Symbols 101CS Manesh T20

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

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 101CS Manesh T22

DECISION STRUCTURES is A>B YN Print A Print B 101CS Manesh T23

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

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

Problem: Write Algorithm and Flowchart to find solution of Quadratic equation 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 START Read a, b, c d  sqrt(b x b – 4 x a x c) STOP x 1  (–b + d) / (2 x a) X 2  (–b – d) / (2 x a) Print X1, X2 101CS Manesh T26

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

Instructions to students Study definition well Study different algorithms well Study how to draw flowchart for specific problems. Work-out various assignment problems Approach me for any doubt clarifications 101CS Manesh T28