Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

Andrew C. Samuels, Information Technology Specialist Trainer c/o Ministry of Education Mona High School, Kingston, Jamaica 1 Problem Solving Section 2:
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING TECHNIQUES
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Documentation Letts Study Guide Information Systems - IT Chapter 19.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
INTRODUCTION TO PROGRAMMING
Chapter 2- Visual Basic Schneider
Defining Control Structures
Program Flow Charting How to tackle the beginning stage a program design.
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 2: Input, Processing, and Output
Chapter 5 Problem Solving with the Sequential Logic Structure
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
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.
The Software Development Cycle Defining and understanding the problem.
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.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Planning for the Solution
Chapter 2: Beginning the Problem-Solving Process
Problem Solving with the Sequential Logic Structure Lesson 5 McManusCOP10061.
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.
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.
CSEB114: Principle of programming
Programming Concepts Chapter 3.
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.
Flowcharts.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Procedural Programming. Programming Process 1.Understand the problem 2.Outline a general solution 3.Decompose the general solution into manageable component.
1 Program Planning and Design Important stages before actual program is written.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
REBUS. REBUS CROSS ROADS HITTING BELOW THE BELT.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
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.
An Introduction to Programming with C++ Sixth Edition
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.
MIT App Inventor Lesson 3 Algorithms Variables Procedures.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
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.
Computer Programming 12 Lesson 4 - Computer Programming Structure By Dan Lunney.
Chapter One Problem Solving
Flow Charts Basic Flow Chart Symbols Few sample flowcharts Rules
Chapter One Problem Solving
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.
2.0 Problem Solving PROGRAM DESIGN
Pseudocode & Flowcharts
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
Understanding Problems and how to Solve them by using Computers
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Data and Flowcharts Session
Data and Flowcharts Session
Chapter 2: Input, Processing, and Output
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney

Tools for Organizing Problems Problem Analysis Chart Problem Analysis Chart Interactivity or Structure Chart Interactivity or Structure Chart IPO Chart IPO Chart Algorithms Algorithms Flowcharts Flowcharts Internal and External Documentation Internal and External Documentation

Problem Analysis Chart Contains four parts Contains four parts Given data Given data Required results Required results Processing Processing List of solution alternatives List of solution alternatives Comes in the form of a chart Comes in the form of a chart

Problem Analysis Chart (cont.) Given Data Required Result Information we know Information we need to find Processing Solution Alternatives How to determine required information List of ideas for the solution of the problem

Problem Analysis Chart (cont.) Sample problem: Sample problem: Calculate the area of a circle for any given radius Calculate the area of a circle for any given radius

Problem Analysis Chart (cont.) Given Data Required Result Processing Solution Alternatives Pi Radius 1.Set both radius and pi in program 2.Get both radius and pi from user 3.Set pi and get radius 4.Set radius and get pi Area = pi * radius * radius Area of the circle

Interactivity or Structure Chart Organizes the problem into sub- tasks Organizes the problem into sub- tasks Often looks like an organizational chart or web diagram Often looks like an organizational chart or web diagram

Interactivity or Structure Chart (cont.) Control 0000 Module Module Module

Interactivity or Structure Chart (cont.) Area of Circle Control 0000 Read 1000 Calculate 2000 Display 3000

IPO Chart Input/Processing/Output Input/Processing/Output Contains 4 Columns Contains 4 Columns Input Input Processing Processing Module Reference Module Reference Output Output Looks like a chart Looks like a chart

IPO Chart (cont.) InputProcessing Module reference Output All know data from PAC (problem analysis chart) All processes that are required Module number where it takes place Result

IPO Chart (cont.) InputProcessing Module reference Output RadiusPi 1. Enter Radius 2. Get pi value 3. Calculate area 4. Display Area Area

Algorithms An algorithm is a set of step-by- step instructions An algorithm is a set of step-by- step instructions Sometimes called Pseudocode Sometimes called Pseudocode It is the key component to solving any problem It is the key component to solving any problem Cannot assume anything, cannot skip steps, must be executable one step at a time, must be complete Cannot assume anything, cannot skip steps, must be executable one step at a time, must be complete

Algorithms Control module (name of module) Control module (name of module) 1. Instruction 1. Instruction 2. Instruction 2. Instruction 3. Instruction 3. Instruction... Exit Exit

Algorithms Area of Circle Control Module Area of Circle Control Module(0000) 1. Process Read 1. Process Read 2. Process Calculate 2. Process Calculate 3. Process Display 3. Process Display 4. Exit 4. Exit

Algorithms Read Module Read Module(1000) 1. Read radius 1. Read radius 2. Exit 2. Exit

Algorithms Calculate Module Calculate Module(2000) 1. area = pi * radius * radius 1. area = pi * radius * radius 2. Exit 2. Exit

Algorithms Display Module Display Module (3000) (3000) 1. Print area 1. Print area 2. Exit 2. Exit

Flowchart Programmers use algorithms to create flowcharts Programmers use algorithms to create flowcharts Flowcharts are graphic representations of the algorithms Flowcharts are graphic representations of the algorithms Flowcharts have symbols to represent parts of the program Flowcharts have symbols to represent parts of the program Often flowcharts will show errors that may not been seen easily in other organizing charts Often flowcharts will show errors that may not been seen easily in other organizing charts

Flowchart Symbols Data flow line Start/Stop/Exit Process Decision Input/Output Module

Flowchart Example To see a demonstration of how to create a flowchart click the link: To see a demonstration of how to create a flowchart click the link: Sample flowchart video Sample flowchart video Sample flowchart video Sample flowchart video

Flowchart Sample Control Read Calculate Display Exit

Flowchart Sample (cont.) Read Calculate Display Exit Read radius Area = pi * pi * radius Print area

Internal / External Documentation Internal documentation – notes written inside the program for other programmers to read. Lets them know what parts of the program are doing. Internal documentation – notes written inside the program for other programmers to read. Lets them know what parts of the program are doing. External documentation – usually consists of the user manuals for your program so the end user can fully understand how to install and use your program. External documentation – usually consists of the user manuals for your program so the end user can fully understand how to install and use your program.

Sample Problem – Lesson 2 Create a PAC, Structure Chart, IPO Chart, Algorithms, and Flowcharts for the following problem: Create a PAC, Structure Chart, IPO Chart, Algorithms, and Flowcharts for the following problem: Calculate the gross pay for employees based on rate, hours, and overtime hours Calculate the gross pay for employees based on rate, hours, and overtime hours See sample problem sheet See sample problem sheet See sample problem sheet See sample problem sheet