The Program Development Cycle and Program Design Tools
Published byModified over 6 years ago
Presentation on theme: "The Program Development Cycle and Program Design Tools"— Presentation transcript:
1 The Program Development Cycle and Program Design Tools Problem SolvingThe Program Development Cycle andProgram Design Tools
2 Performing a Task on the Computer Determine the outputIdentify the inputDetermine how to process the input to obtain the outputInputProcessOutput
3 Program Development Cycle AnalyzeDefine the problemDesignDevelop an algorithmChoose the interfaceSelect the objectsCodeTest and DebugComplete the documentationYou 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 ToolsFlowcharts – 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 ConnectorOffpage connectorMicrosoft 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 milesProcessing: convert miles to kilometers1 mile = kilometersOutput: distance in kilometers
7 Hierarchy Chart Kilometers to miles conversion program Convert from miles to kilometersDisplay distance in kilometersGet distance in milesA 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 kilometersEnd
9 Pseudocode Get distance in miles Convert the distance to kilometers The distance in kilometers is the distance in milesDisplay 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 numberProcessing: Decide if the street number is divisible by 2Output: “Eastbound” or “Westbound”
11 Hierarchy Chart Street direction program Decide whether street number is even or oddDisplay directionGet street number
12 Flowchart Start Get Street Number Is Street Number Even? Display NoYesDisplayWestboundDisplayEastboundEnd
13 Pseudocode Get Street number If Street number is even Then Display EastboundElseDisplay Westbound