Simple Program Design Third Edition A Step-by-Step Approach

Slides:



Advertisements
Similar presentations
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Advertisements

Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
Program Design Tool. 6 Basic Computer Operations Receive information Put out information Perform arithmetic Assign a value to variable (memory location)
Steps in Program Development
Chapter 2: Algorithm Discovery and Design
Program Design and Development
Chapter 2: Input, Processing, and Output
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Modules, Hierarchy Charts, and Documentation
Chapter 2: Algorithm Discovery and Design
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 1 Program Design
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
Pseudocode.
Chapter 3 Planning Your Solution
PRE-PROGRAMMING PHASE
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
First Steps in Modularization Simple Program Design Third Edition A Step-by-Step Approach 8.
Programming Concepts Chapter 3.
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Developing an Algorithm
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.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Pseudocode Algorithms Using Sequence, Selection, and Repetition Simple Program Design Third Edition A Step-by-Step Approach 6.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Developing an Algorithm. Simple Program Design, Fourth Edition Chapter 3 2 Objectives In this chapter you will be able to: Introduce methods of analyzing.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Chapter 8 First steps in modularisation. Objectives To introduce modularisation as a means of dividing a problem into subtasks To present hierarchy charts.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Computer Programming CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
CSCI-235 Micro-Computer Applications
Chapter 2: Input, Processing, and Output
Chapter 2- Visual Basic Schneider
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Algorithm and Ambiguity
Unit# 9: Computer Program Development
Program Design Introduction to Computer Programming By:
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
Algorithm and Ambiguity
Chapter 2: Input, Processing, and Output
Chapter 4: Writing and Designing a Complete Program
Presentation transcript:

Simple Program Design Third Edition A Step-by-Step Approach 1 Program Design Simple Program Design Third Edition A Step-by-Step Approach

1 Objectives To describe the steps in the program development process To explain structured programming To introduce algorithms and pseudocode To describe program data

Steps in Program Development 1 Steps in Program Development Programming can be defined as the development of a solution to an identified program, and setting up of a related series of instructions which, when directed through computer hardware, will produce the desired results There are seven basic steps in the development of a program

1 Define the Problem To help with this initial analysis, the problem should be divided into three separate components: The inputs The outputs, and The processing steps to produce the required outputs A defining diagram is recommended in this analysis phase, as it helps to separate the define and the three components

1 Outline the Solution This initial outline is usually a rough draft of the solution which may include: The major processing steps involved The major subtasks (if any) The major control structures (e.g. repetition loops) The major variables and record structures The mainline logic The solution outline may also include a hierarchy or structure chart

Develop the Outline into an Algorithm 1 Develop the Outline into an Algorithm The solution outline developed in Step 2 is then expanded into an algorithm: a set of precise steps that describe exactly the tasks to be performed, and the order in which they are to be carried out This book uses pseudocode (a form of structured English) to represent the solution algorithm, as well as structure programming techniques

Test the Algorithm for Correctness 1 Test the Algorithm for Correctness This step is one of the most important in the development of a program, and yet it is the step most often forgotten The main purpose of desk checking the algorithm is to identify major logic errors early, so that they may be easily corrected Test data needs to be walked through each step in the algorithm, to check that the instructions described in the algorithm will actually do what they are supposed to

Code the Algorithm into a Specific Programming Language 1 Code the Algorithm into a Specific Programming Language Only after all design considerations have been met should you actually start to code the program into your chosen programming language

Run the Program on the Computer 1 Run the Program on the Computer This step uses a program compiler and programmer-designed test data to machine test the code for syntax errors

Document and Maintain the Program 1 Document and Maintain the Program Program documentation should not be listed as the last step in the program development process, it is really an ongoing task from the initial definition of the problem to the final test result Documentation involves both external documentation (such as hierarchy charts) and internal documentation that may have been coded in the program

Structured Programming 1 Structured Programming Structured programming helps you to write effective, error-free programs The original concept of structured programming was set out in a paper published in 1964 in Italy by Bohm and Jacopini They established the idea of designing programs using a Structure Theorem based on three control structures This term now refers not only to the Structure Theorem itself, but also to top-down development and modular design

1 Top-down Development Programmers presented with a programming problem would start coding at the beginning of the problem and work systematically through each step until reaching the end In the top-down development of a program design, a general solution to the problem is outlined first

1 Modular Design Structured programming also incorporates the concept of modular design, which involves grouping tasks together because they all perform the same function (e.g. calculating sales tax or printing report headings) Modular design is connected directly to top-down development, as the steps or subtasks into which the programmer breaks up the program solution will actually form the future modules of the program

1 The Structure Theorem The Structure Theorem revolutionized program design by eliminating the GOTO statement and establishing a structured framework for representing the solution The theorem states that it is possible to write any computer program by using only three basic control structures These control structures are: Sequence Selection, or IF-THEM-ELSE Repetition, or DOWHILE

An Introduction to Algorithms and Pseudocode 1 An Introduction to Algorithms and Pseudocode Structured programming techniques require a program to be properly designed before coding begins, and it is this design process that results in the construction of an algorithm

1 What is an Algorithm? An algorithm lists the steps involved in accomplishing a task It can be defined in programming terms as a set of detailed, unambiguous and ordered instructions, developed to describe the processes necessary to produce the desired output from a given input

1 What is an Algorithm? An algorithm must: be lucid, precise, and unamibiguous give the correct solution in all cases eventually end It is important to use indentation when writing solution algorithms because it helps to differentiate between the three control structures

1 What is Pseudocode? Pseudocode, flowcharts, and Nassi- Schneiderman diagrams are all popular ways of representing algorithms Pseudocode is structured English There is no standard pseudocode at present This book attempts to establish a standard pseudocode for use by all programmers, regardless of the programming language they choose

1 What is Pseudocode? Like many versions of pseudocode, this version has certain conventions, as follows: 1. Statements are written in simple English 2. Each instruction is written on a separate line 3. Keywords and indentation are used to signify particular control structures 4. Each set of instructions is written from top to bottom, with only one entry and one exit 5. Groups of statements may be formed into modules, and that group given a name

1 Program Data Data within a program may be a single variable, such as an integer or a character; or a group item (sometimes called an aggregate), such as an array, or a file

Variables, Constants, and Literals 1 Variables, Constants, and Literals A variable is the name given to a collection of memory cells, designed to store a particular data item It is called a variable because the value stored in that variable may change or vary as the program executes A constant is a data item with a name and a value that remain the same during the execution of the program A literal is a constant whose name is the written representation of its value

1 Elementary Data Items An elementary data item is one containing a single variable that is always treated as a unit These data items are usually classified into data types A data type consists of a set of data values and a set of operations that can be performed on those values The most common elementary data types are: integer – real character – Boolean

1 Data Structures A data structure is an aggregate of other data items The data items that it contains are its components, which may be elementary data items or another data structure The most common data structures are: record file array string

1 Summary The steps in programming development introduced in the text are as follows: 1. Define the problem 2. Outline the solution 3. Develop the outline into an alogirthm 4. Test the algorithm for correctness 5. Code the algorithm into a specific programming language 6. Run the program on the computer 7. Document and maintain the program

1 Summary Structured programming is presented in the text as a combination of three separate concepts: Top-down development Modular design The use of the Structure Theorem when designing a solution to a problem Programmers need to have a good understanding of the data to be processed, therefore data variables, constants, and literals were defined, as well as elementary data items and data structures