Software Life Cycle What Requirements Gathering, Problem definition

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
PROBLEM SOLVING TECHNIQUES
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
Chapter 2- Visual Basic Schneider
Developing logic (Examples on algorithm and flowchart)
The Program Design Phases
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
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
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.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Chapter 1 Pseudocode & Flowcharts
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.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
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.
 Problem Analysis  Coding  Debugging  Testing.
Chapter 1 Introduction 2nd Semester H
Program design Program Design Process has 2 phases:
ALGORITHMS AND FLOWCHARTS
GC101 Introduction to computers and programs
Programming Languages
Unit 3: ALGORITHMS AND FLOWCHARTS
Computer Programming.
Algorithm & Programming
ALGORITHMS AND FLOWCHARTS
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Computer Programming Flowchart.
Algorithms and Flowcharts
Programming Fundamentals
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
Unit# 9: Computer Program Development
ALGORITHMS AND FLOWCHARTS
Structured Program
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
Introduction to Algorithms and Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Computer Programming.
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Programming
Basic Concepts of Algorithm
Chapter 1 Pseudocode & Flowcharts
Presentation transcript:

Software Life Cycle What Requirements Gathering, Problem definition How Analysis and Design (Programming techniques) Do it Coding Test Testing Use Implementation and Maintenance

Coding and Testing Write Program Compile Program Run and Test Program Submit Program Success Correct Errors Errors

How to develop a program Identify the steps and execution sequence. Every program consist of mainly three parts: Input, Processing and Output Example: Add two numbers Steps Read/Input two numbers Add these two numbers Display/Output the result of addition Algorithm : Steps written in English language. Program : Algorithm written in a specific high level language.

Algorithm An Algorithm is a solution to a problem that is independent of any programming language. An Algorithm is a finite sequence of steps each step shall be clearly stated and understandable for each input, it shall terminate in finite time with output How we solve the problem with Computer?

Program and Programming A set of instruction written in a programming language that a computer can execute so that the machine acts in a predetermined way. Program solves a problem Before writing a program: Have a thorough understanding of the problem Carefully plan an approach for solving it. Programming: The Process of providing instructions to the computer that tells the processor what to do.

Algorithms & Programs An Algorithm is a solution to a problem that is independent of any programming language. While A program is an algorithm expressed using a specific set of instructions from any programming language.

Algorithm Example Maximum of two numbers Steps: Read/input two numbers Compare two numbers Print the Greater number Average of three numbers Read/input three numbers Add three numbers divide the sum by 3. Print the result of divison

Pseudocode This is a common notation for writing algorithms. Mixture of English language statement and a programming language( like C) code. It is an intermediate step in writing a program. Not actually executed on computers. Standard mathematical notations like exponents,square-root symbols etc. are allowed in pseudocode.

Rules for pseudo code The beginning and end of a pseudo code is marked with keywords START and STOP. Every variable should be initialized in the beginning only using INITAILZE Values from user should be accepted using keyword READ, and should be display using WRITE. All “alphanumeric” values should be enclosed in single or double quotes. All the nested loops are: for-do-done, while-do-done All the control structures are: if-then-else-fi, switch-case.

Examples Pseudo code to find out the sum of all odd numbers in the range 1 to 10. START INITIALIZE a[10], sum=0,i for i=1 to 10 do Read a[i]; if (condition) then Calculate sum=sum+a[i]; done Write sum; STOP

Examples Pseudo code to find out the maximum number from 20 given numbers. START INITIALIZE a[20],max,i; for i=1 to 20 do Read a[i]; done max=a[1]; for i=2 to 20 do if a[i]>max then Assign max=a[i]; Write max; STOP

Practice Example Write an algorithm for the given problem: 10 students of a class appears for a test in three subjects. Each test is out of 100 marks. The percentage of each student has to be calculated and depending on the percentage calculated, grades are given below: Percentage Grade > =80 A 60-79 B <=59 C

Flowchart Graphical representation of an algorithm Components: Arrows/lines :Flow of control Parallelogram: Indicates input and output operations Rectangle symbol (action symbol): Indicates any type of action/computational step Oval symbol:Indicates the beginning or end of a program or a section of code Diamond: Decision

Flowchart Notations Arrows Diamond Parallelogram Oval Rectangle

Example: Add two Numbers READ A,B C=A+B PRINT C START STOP

Draw both flow chart and pseudo code You are required to calculate area of circle and rectangle. Accept from user the figure and then accordingly calculate and display.

Pseudo code label 1: START INITIALIZE FIG, area=0; READ FIG ; IF FIG = “circle” CALL CIR_ROUTINE ; ELSE IF FIG=“rectangle” CALL RECT_ROUTINE ; GOTO label 1; ENDIF WRITE “ area of figure”, area; STOP label 1:

CIR_ROUTINE INITIALIZE radius=0; READ radius; CALCULATE area = 3.14 * radius * radius; RETURN to Calling procedure RECT_ROUTINE INITIALIZE length=0, width=0; READ length,width; CALCULATE area = length*width; RETURN to Calling procedure

Flow Chart READ FIG START FIG? other rectangle READ LENGTH & WIDTH circle READ RADIUS AREA=LENGTH * WIDTH PRINT AREA AREA=3.14*RADIUS * RADIUS STOP

Problems GCD of three numbers Calculate 2n Roots of equation ax2+bx+c=0 Largest of N numbers Generate the fibonacci series