ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Similar documents
Programming Languages and Program Development Life Cycle Fall Introduction to Information and Communication Technologies CSD 102

S/W Programming & Languages

Chapter Twelve. Systems Design and Development

Introduction to Computer Programming/Handout 01 Page 1 of 13

PC204. Lecture 5 Programming Methodologies. Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved.

Discovering Computers Chapter 13 Programming Languages and Program Development

Outline. Program development cycle. Algorithms development and representation. Examples.

Unit II. (i) Computer Programming Languages

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

C++ Programming Language Lecture 2 Problem Analysis and Solution Representation

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

Low-Level Languages. Computer Programs and Programming Languages

SNS COLLEGE OF ENGINEERING,

Compilers. Prerequisites

Technology in Action. Chapter Topics (cont.) Chapter Topics. Reasons for Software Programming. Information Systems 10/29/2010

Technology in Action. Chapter Topics. Scope creep occurs when: 3/20/2013. Information Systems include all EXCEPT the following:

Managing Change and Complexity

CSC Advanced Object Oriented Programming, Spring Overview

Simply Java Programming: An Application Driven, Tutorial

Copyright 2005 Department of Computer & Information Science

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

PROBLEM SOLVING AND PYTHON PROGRAMMING

Higher Computing Science Software Design and Development - Programming Summary Notes

SOFTWARE ANALYSIS & DESIGN TOOLS

INFS 214: Introduction to Computing

CS SOFTWARE ENGINEERING QUESTION BANK SIXTEEN MARKS

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Programming Languages and Program Development

Systems Analysis & Design

Software Design. Levels in Design Process. Design Methodologies. Levels..

Programming Logic And Design Second Edition Introductory

The births of the generations are as follow. First generation, 1945 machine language Second generation, mid 1950s assembly language.

COP 1220 Introduction to Programming in C++ Course Justification

Discovering Computers 2008

COMPILER DESIGN LECTURE NOTES

Computer Programming-I. Developed by: Strawberry

PROGRAMMING Programming is a creation of a set of commands or instructions which directs a computer in carrying out a task.

NCC EDUCATION INTERNATIONAL DIPLOMA IN COMPUTER STUDIES SYSTEMS DEVELOPMENT. 5 th June 2005

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Final Paper/Best Practice/Tutorial Advantages OF BDD Testing

Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs

Chapter 1: Principles of Programming and Software Engineering

Principles of Programming Languages. Lecture Outline

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Introduction to Scientific Computing Languages

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

A Beginner s Guide to Programming Logic, Introductory. Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Introduction to Programming

Python - Week 1. Mohammad Shokoohi-Yekta

Introduction to Scientific Computing Languages

Högnivåspråk och översättning

gg--c}/-/j) r x Revision: New: COBOL I TWO Date: Author: Date SAULT COLLEGE OF APPLIED ARTS & TECHNOLOGY SAULT STE. MARIE, ONTARIO

III. Check if the divisors add up to the number. Now we may consider each of these tasks separately, assuming the others will be taken care of

SNS COLLEGE OF ENGINEERING

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Software Testing. Overview

UNIT I Programming Language Syntax and semantics. Kainjan Sanghavi

Outline. software testing: search bugs black-box and white-box testing static and dynamic testing

TASKS IN THE SYSTEMS DEVELOPMENT LIFE CYCLE

SLIDE 2. At the beginning of the lecture, we answer question: On what platform the system will work when discussing this subject?

Algorithm: 1. Introduction

FLOW CHART AND PSEUDO CODE

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

Indicate the answer choice that best completes the statement or answers the question. Enter the appropriate word(s) to complete the statement.

Programming Paradigms

CENTRAL TEXAS COLLEGE COSC 1315 INTRODUCTION TO COMPUTER PROGRAMMING. Semester Hours Credit: 3 INSTRUCTOR: OFFICE HOURS:

How to approach a computational problem

Lecture 1: Preliminaries

Systems Analysis and Design in a Changing World, Fourth Edition

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Chapter 4: Writing and Designing a Complete Program. Programming Logic and Design, Third Edition Introductory

Steps to program development

CS101 Introduction to Programming Languages and Compilers

Introduction to Computer Programming Using FORTRAN 77

1. Review of program specifications 2. Program design 3. Coding 4. Testing 5. Finalizing documentation

Procedural Programming

Working with JavaScript

Chapter 9. Introduction to High-Level Language Programming. INVITATION TO Computer Science

Module 1: Introduction to Computers, Programs, and Java

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Concepts of Programming Languages

PLD Semester Exam Study Guide Dec. 2018

Functions. Lecture 6 COP 3014 Spring February 11, 2018

Chapter 8 Structuring System Logic Requirements

Imperative Programming Languages (IPL)

TABLE OF CONTENTS 2 CHAPTER 1 3 CHAPTER 2 4 CHAPTER 3 5 CHAPTER 4. Algorithm Design & Problem Solving. Data Representation.

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Tenth Edition. Copyright 2014 Pearson Education, Inc. Publishing as Prentice Hall

Com S 541. Programming Languages I

Scheme of work Cambridge International AS & A Level Computing (9691)

Software Design and Analysis for Engineers

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Transcription:

ITC213: STRUCTURED PROGRAMMING Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Lecture 03: Program Development Life Cycle Readings: Not Covered in Textbook

Program Development Life Cycle Creating new programs is called program development The process associated with creating successful applications programs is called the program development life cycle (PDLC) It includes a set of activities which produce application programs There are various approaches in program development each with different perspectives Bhaskar Shrestha 3

Waterfall model The first published model of program development process was derived from other engineering process (Royce, 1970) It is a multistage model with each stage concerned with separate activities of program development Each stage in the model follows a linear sequence one after another, often with feedback loops Also known as classic life cycle, linear sequential model Bhaskar Shrestha 4

Waterfall Model Problem Analysis Program Design Coding Testing Maintenance Bhaskar Shrestha 5

Problem Analysis: Define the Problem (1/2) The stage begins with reviewing the program specifications indicating what the new system should do During this stage, the systems analyst and programmer review the specifications and possibly talk with users in order to fully understand what the software should do. Documentation resulting from this phase consists of the program specifications, timetable, which language will be used, how the program will be tested, and what documentation is required Bhaskar Shrestha 6

Problem Analysis: Define the Problem (2/2) The program services, constraints and objectives are established by consultation with system users Consists of the following tasks: Define Objectives of the Program Determine desired outputs Determine input requirements Determine processing requirements Evaluate feasibility of the program Document the analysis Bhaskar Shrestha 7

Program Design: Outline the Solution During program design, the specifications are used to express the algorithm needed to solve the problem, usually in the form of any number of program design tools Program Design Tools Structure charts Flowcharts Pseudocode Data modeling Documentation from the program design step includes all the design specifications (flowcharts, pseudocode, etc.) Bhaskar Shrestha 8

Structure Charts and Data Modeling Structure charts depict the overall organization of a program, and how the modules of a program logically related operations that perform a well-defined task are defined and how they connect to each other hierarchically Program modules should be arranged hierarchically, in a top-down fashion, so that their relationship to each other is apparent Data modeling is a technique used to illustrate the data in an application and is frequently used with object-oriented programming In a data model, the objects in the program are identified, along with their variables and class Bhaskar Shrestha 9

Structured Programming Today most programmers use a design approach called structured programming Structured programming takes a top-down approach that breaks programs into modular forms It uses standard logic tools called control structures Developed by Bohm and Jacopini Key design considerations Top down design Modular design Structure Theorem Bhaskar Shrestha 10

Top-down Design Top-down program design proceeds by identifying the function of the program and then breaking it down, in hierarchical fashion, to specify the processing steps, or modules, required to perform that function, down to the lowest level of detail Start with what you want Break it into parts If the parts are non trivial then else apply top-down again Design is done Bhaskar Shrestha 11

Example Top-down program design can be represented graphically in a hierarchy chart Compute Tax Compute adjusted gross income Compute deductions Compute credits Compute adjustments Compute Income Interest & dividends Business Wages Capital Misc. income gains Income Bhaskar Shrestha 12

Modular Design Modularization simplifies program design by allowing the individual program modules to be developed and tested separately Groups tasks which perform the same function A module (sometimes called a subprogram or a subroutine) is a self-contained processing step, consisting of logically related program statements It is best if each module has only a single function, just as an English paragraph should have a single, complete thought Bhaskar Shrestha 13

Structured Theorem Advocates of structured programming have shown that any program can be constructed out of three fundamental control structures: sequence, selection, and iteration A control structure, or logic structure, controls the logical sequence in which computer program instructions are executed A sequence control structure is simply a series of procedures that follow one another. The selection control structure involves a choice: It offers two or more paths to follow at points in the program where a decision must be made An iteration is an operation that repeats until a certain condition is met Eliminates the GOTO (used in unstructured programming) Bhaskar Shrestha 14

Structured Programming The point of structured programming is to make programs more efficient and better organized (more readable), and to have better notations so that they have clear and correct descriptions In structured programming, the program is designed in three mini-steps: Determine the Program Logic, Using a Top-Down Approach Design Details, Using Pseudocode, Flowcharts, and Control Structures Do a Structured Walkthrough Bhaskar Shrestha 15

Structured Walkthrough In the structured walkthrough, a programmer leads other people in the development team through a design segment The structured walkthrough, the final part of the design phase, consists of a formal review process in which others fellow programmers, systems analysts, and perhaps users The team reviews the segment of the program for errors, omissions, and duplications in the processing tasks Because the whole program is still on paper at this point, these matters are easier to correct than they will be later Bhaskar Shrestha 16

Coding: Code the Program Once the design has been developed and reviewed in a walkthrough, the next step is the actual writing of the program, called coding Coding consists of translating the logic requirements from pseudocode or flowcharts into a programming language the letters, numbers, and symbols arranged according to syntax rules (language rules) that make up the program. The program coding stage results in finished source code, which includes enough internal documentation to make the source code understandable and easy to update Bhaskar Shrestha 17

Coding: Code the Program One of the first steps in the coding process is deciding which programming language to use Languages for specific applications are often chosen with respect to such criteria as suitability, compatibility with other applications, organizational standards, programmer availability, portability, and speed For a program to work, you have to follow the syntax, the rules of the programming language that specify how words and symbols are put together Bhaskar Shrestha 18

Coding: Code the Program Many organizations enforce rules called coding standards to standardize programming styles and make programs more universally readable and easier to maintain Reusable code refers to code segments that can be used over and over again, by several programs The idea behind reusable code is that programs will take less time to write and contain fewer errors if error-free, reusablecode modules can be stitched together to form programs Bhaskar Shrestha 19

Testing (1/3) Once a program is coded, it must be tested for its correctness Program testing involves running various tests 1. Perform Desk-Checking: Desk-checking is simply reading through, or checking, the program to make sure that it s free of errors and that the logic works. In other words, desk-checking is like proofreading. This step should be taken before the program is actually run on a computer Bhaskar Shrestha 20

Testing (2/3) 2. Debug the Program: Debugging means detecting, locating, and removing all errors in a computer program Mistakes may be in syntax errors or logic errors: Syntax errors are caused by typographical errors and incorrect use of the programming language. These are the easiest bugs to fix. Debugging utility programs (sometimes called diagnostics) check program syntax and display syntax-error messages. Logic errors are caused by incorrect use of control structures resulting in incorrect program results. Bhaskar Shrestha 21

Debugging Tools Many compilers provide the programmer with debugging tools, such as displaying informative error messages indicating the source of many of the errors, colored-coded source code, etc Temporary dummy output statements can be used to help identify where program execution goes and display the values of loop counters and other key variables Bhaskar Shrestha 22

Testing (3/3) 3. Run Real-World Data: After desk-checking and debugging, the program may run fine in the laboratory. However, it then needs to be tested with real data, called beta testing It s mandatory to test with bad data data that is faulty, incomplete, or in overwhelming quantities to see if you can make the system crash. The testing process may involve several trials using different test data before the programming team is satisfied the program can be released The documentation resulting from this step includes a copy of the finished program code, plus test data and results Bhaskar Shrestha 23

Documentation & Maintenance (1/2) Preparing documentation is the fifth step in programming. The resulting documentation consists of written, graphic, and electronic descriptions of what a program is and how to use it. Documentation is needed for everyone who will be involved with the program Preparing User Documentation Prepare Operator Documentation Write Programmer Documentation Bhaskar Shrestha 24

Documentation & Maintenance (2/2) Virtually every program, if it is to last a long time, requires ongoing maintenance. Program maintenance is the process of updating software so that it continues to be useful It is a costly process, but can be used to extend the life of a program Documentation resulting from this step consists of the amended program package reflecting what problems occurred and what program changes were performed Bhaskar Shrestha 25

Tools for Facilitating Program Development Program development tools can be used to facilitate the program development process An application generator enables both programmers and end users to code new applications quickly Common examples are wizards, macro languages, report generators, form generators, graphics generators, and code generators. Bhaskar Shrestha 26

Tools for Facilitating Program Development The basic strategy of computer-aided software engineering (CASE) tools is to automate one or more steps of applications software development All CASE tools are different, but many contain such features as action-diagram editors, fourth-generation-language programming, code generators, reusable-code-management routines, and active data dictionaries Rapid application development (RAD) refers to a group of tools that enable software development to take place during the entire program development process RAD tools provide CASE-like assistance for developing user interfaces, preparing code for reuse, etc Bhaskar Shrestha 27

Programming Paradigms: Procedural Programming Procedural Programming is based upon the concept of the modularity A main procedural program is composed of one or more modules. Each module is composed of one or more subprograms. Procedural code is easier to read and more maintainable is more flexible facilitates the practice of good program design Bhaskar Shrestha 28

Programming Paradigms: Declarative and Object oriented Programming Declarative programming describes to the computer a set of conditions and lets the computer figure out how to satisfy them Object oriented programming A computer program is composed of a collection of individual units, called objects. Operations are provided for each class of objects. Operations change the state of an object. To make the overall computation happen, the objects interact through their own operations and their own data Bhaskar Shrestha 29

Example languages for Different Paradigms Procedural C, Pascal, Basic, FORTRAN, COBOL, Ada Declarative LISP, Prolog, Objected oriented Smalltalk, Java, C++, Bhaskar Shrestha 30