Download presentation
Presentation is loading. Please wait.
1
The Program Development Cycle and Program Design Tools
Problem Solving The Program Development Cycle and Program Design Tools
2
Performing a Task on the Computer
Determine the output Identify the input Determine how to process the input to obtain the output Input Process Output
3
Program Development Cycle
Analyze Define the problem Design Develop an algorithm Choose the interface Select the objects Code Test and Debug Complete the documentation You will spend much less time working on a program if you carefully devise a plan before actually writing the program. Analyze – Make sure you understand what the program should do and what the relationship between the input and output should be. Design – Find a logical sequence of steps that solve the problem and develop a logic plan using hierarchy charts, flowcharts or pseudocode. Choose the interface – Determine how the input will be obtained and how the output will be displayed. Also, create appropriate command buttons to allow the user to control the program. Code – Translate the algorithm into a programming language. Test and debug – locate and remove any errors from the program. Mention compiler errors, runtime errors and logic errors. Documentation – Documentation is intended to allow another person, or the programmer at a later date, to understand the program. Although documentation is listed as the last step in the program development cycle, it should take place as the program is being coded.
4
Program Design Tools Flowcharts – Graphically depict the logical steps to carry out a task and show how the steps relate to each other. Pseudocode – Uses English-like phrases with some Visual Basic terms to outline the task. Hierarchy charts – Show how the different parts of a program relate to each other.
5
Flowcharts Flowline Terminator Input/Output Processing Decision
Connector Offpage connector Microsoft Word has the flowchart symbols as part of it’s AutoShape menu.
6
Miles to Kilometers Conversion Program
Problem: Your summer surveying job requires you do calculations of distances in kilometers. All of your data is in miles. Write a program the performs the necessary conversion. Input: distance in miles Processing: convert miles to kilometers 1 mile = kilometers Output: distance in kilometers
7
Hierarchy Chart Kilometers to miles conversion program
Convert from miles to kilometers Display distance in kilometers Get distance in miles A hierarchy chart, sometimes called a top-down chart, shows the overall program structure. Hierarchy charts depict the organization of a program but omit the specific processing logic. They describe what each part, or module, of the program does and and they show how the modules relate to each other. The chart is read from top to bottom and from left to right. The main benefit of hierarchy charts is in the initial planning of a program. The major parts of the program are broken down into modules, and then each module is refined into more detailed plans using flowcharts or pseudocode.
8
Flowchart Start Get distance in miles Set kilometers = 1.609 * miles
Display distance in kilometers End
9
Pseudocode Get distance in miles Convert the distance to kilometers
The distance in kilometers is the distance in miles Display the distance in kilometers
10
Direction of Numbered NYC Streets Algorithm
Problem: Given a street number of a one-way street in New York, decide the direction of the street. (hint: even numbered streets run eastbound) Input: Street number Processing: Decide if the street number is divisible by 2 Output: “Eastbound” or “Westbound”
11
Hierarchy Chart Street direction program
Decide whether street number is even or odd Display direction Get street number
12
Flowchart Start Get Street Number Is Street Number Even? Display
No Yes Display Westbound Display Eastbound End
13
Pseudocode Get Street number If Street number is even Then
Display Eastbound Else Display Westbound
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.