Programming Concepts Chapter 3.

Slides:



Advertisements
Similar presentations
Chapter 1 - An Introduction to Computers and Problem Solving
Advertisements

Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Documentation Letts Study Guide Information Systems - IT Chapter 19.
Reference :Understanding Computers
Chapter 2- Visual Basic Schneider
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: Algorithm Discovery and Design
Chapter 3 Planning Your Solution
The Program Design Phases
Review Algorithm Analysis Problem Solving Space Complexity
PRE-PROGRAMMING PHASE
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Simple Program Design Third Edition A Step-by-Step Approach
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Planning for the Solution
CSC141 Introduction to Computer Programming
Chapter 2: Beginning the Problem-Solving Process
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Programming Lifecycle
Designing and Debugging Batch and Interactive COBOL Programs Chapter 5.
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.
Lesson 3 McManus COP  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what.
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.
UNIT- I General Problem Solving Concepts
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
ALGORITHM List of instructions for carrying out some process step by step. A sequence of instructions which has a clear meaning and can performed with.
Algorithms & Flowchart
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
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.
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.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
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 2- Visual Basic Schneider
Lecture 2 Introduction to Programming
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.
2.0 Problem Solving PROGRAM DESIGN
Unit# 9: Computer Program Development
Problem Solving Techniques
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
Programming Fundamentals (750113) Ch1. Problem Solving
ICT Gaming Lesson 2.
Programming Fundamentals (750113) Ch1. Problem Solving
Basic Concepts of Algorithm
Programming Logic and Design Eighth Edition
Presentation transcript:

Programming Concepts Chapter 3

Introduction Computers are only as good as their hardware , their softwere and the people using them The programmer have three recourses needed to optimize for effectiveness : computer memory computer time programmer time

Introduction Old days programmers worked alone small memories and slow. Programs hard to mountain and read Over the years computers and programming methods changed The instructions must be understand by the computer (syntax)

Communicating with the computer COP1006 4/23/2017 Communicating with the computer you have to learn its system of communication or language . The meaning of an instruction is essentially the same in many computer language or application. Syntax refers to the rules governing the computer operating system , the application, and the languages. An errors is called a bug . A process called debugging . COP1006_03

Communicating with the computer COP1006 4/23/2017 Communicating with the computer many bugs are result of syntax errors but some are logic errors . All syntax errors must be corrected before you execute and test your program . COP1006_03

Organizing the Problem COP1006 4/23/2017 Organizing the Problem Certain organizational tools will help you learn to solve problems on the computer . The tools include the: Problem Analysis Chart (PAC) Structure/Interactivity Charts Input Processing Output (IPO) Chart Algorithms. Flowcharts COP1006_03

Organizing the problem To analyze a problem and set up the most efficient solution, a programmer organizes the solution by using all or some of these tools. If not use these tools : the solution takes longer to program . the final program is less efficient . lacks readability . increases programmer frustration.

Analyzing the problem Understand the Problem COP1006 4/23/2017 Analyzing the problem Understand the Problem Analyze the Requirements of the Problem A good way to analyze a problem is to separate it into four parts, problem analysis chart( PAC) : The given data.(constant and variables) The required results.(the out put) The processing that is required in the problem .(equations and expressions) A list of solution alternatives . COP1006_03

Problem Analysis Chart (PAC)

PAC Payroll Example Calculate the gross pay of an employee. The formula to be used is GrossPay=Hours*PayRate Develop PAC for a solution to this problem?

COP1006 4/23/2017 PAC Payroll Example COP1006_03

Interactivity (Structure) Chart Divide processing into subtasks called modules Then connect these modules together to show the interaction of processing between modules. Each modules should contain the tasks to accomplish one function. There will be one module that controls the flow to most of other modules called the Control or main module .

Interactivity (Structure) Chart Use the top down method. Divide the problem into subtasks . Illustrate them in the order in which they will be processed from the top to the bottom of the chart. The module that encompasses the complete solution becomes what is called the control module because it controls the processing of all the data . The subtasks of this module are then located below it in the structure chart .

The Interactivity Chart

The Interactivity Chart Indicates duplicate modules by darkening the upper left-hand corner of each module. The darkened circles indicate that the module is part of a set of modules that are processed many time – those in loop . The diamond on the vertical line above the box indicates which modules are involved in a decision . Annotation may be placed beside the circle or diamond to indicate the condition

The Interactivity Chart for the Payroll Problem

Developing Input Processing Output (IPO) Chart IPO chart shows: What data item are input What processing takes place on that data What information will be the end result, the output Where in the solution the processing takes place.

The IPO Chart for the Payroll Problem COP1006 4/23/2017 The IPO Chart for the Payroll Problem The module references are show which will perform each step in the processing COP1006_03

Writing the Algorithm The next step of organizing a solution is to develop sets of instructions for the computer, called algorithms. The programmer writes a separate set of instructions for each module in the structure chart . The number of instruction is determined by the way the programmer chooses to solve the problem .

The Form of an Algorithm The Control module uses an End since this is the end of the processing . The other modules use Exit because the processing continues .

Drawing the Flowchart Graphic representations of the algorithms. COP1006 4/23/2017 Drawing the Flowchart Graphic representations of the algorithms. The algorithms and flowcharts are the final steps in organizing a solution. A flowcharts shows the flow of the processing from the beginning to the end of a solution. Each block in a flowchart represents one instruction from an algorithm. COP1006_03

Drawing the Flowchart Flowlines indicate the direction of the data flow. Most block have one or more entrances Most block have only one exit . Since ,in most cases , data can flow to only one other block . Exception a block representing a decision instruction A loop enables the computer to perform a task repeatedly during the processing of solution .

Flowchart Symbols

Flowchart Symbols

The algorithms and Flowcharts for the Payroll Problem

The algorithms and Flowcharts for the Payroll Problem

Order of Execution of Instructions

Algorithm and Flowchart Form

COP1006 4/23/2017 Documentation Internal documentation consists of remarks written with the instructions to explain what is being done in the program . External documentation is made up of the manuals or help menus written about the solution . COP1006_03

Internal Documentation COP1006 4/23/2017 Internal Documentation proper internal documentation ensures that the new programmer will be able to learn about the program in the least amount of time . Include such things as : People who worked on the program Variable usage Note about the development of the program COP1006_03

External Documentation COP1006 4/23/2017 External Documentation For the user of the program . Allow the end user to find the answers to questions . Should include : Tutorials . Input definition . Usage instruction. Installation instruction . Command explanations . Include any thing that allow the user to learn to use the program in the least amount of time . COP1006_03

COP1006 4/23/2017 Testing the solution Test the a solution to make sure it meet the requirements of the user ,and to check for errors in logic or in the setup of the expressions and equations . To test the solution : Select the data A set of value for the input data Works them through every step in the solution . If a bug is detected the solution has to be modified to correct it. COP1006_03

Coding the solution After determining that the solution is correct COP1006 4/23/2017 Coding the solution After determining that the solution is correct Select the appropriate language Code the program COP1006_03