Chapter 1 - Program Development and Planning
Chapter 1 - Program Development and Planning
and Planning
Introduction to Hardware and Software
Hardware vs. Software
• Hardware: Physical machinery in a computer system
• Examples: monitor, keyboard, CPU
• Software: Collection of instructions (programs) that direct hardware
• Programs are written to solve problems or perform tasks
• Key Insight: Computers only do what we instruct them to do
• Requires careful and thorough instructions
Program Terminology
• A program may also be called:
• Project
• Application
• Solution
Performing Tasks on Computer
Three-Step Problem-Solving Approach
1.Determine the output
1.What should the task produce?
2.Identify the input
1.What data is necessary to obtain the output?
3.Determine the processing
1.How to process input to obtain desired output
2.What formulas or methods can be used?
Algebra Problem Example
Problem: How fast is a car traveling if it goes 50 miles in
2 hours?
• Output: Speed in miles per hour
• Input: Distance (50 miles) and time (2 hours)
• Processing: Speed = Distance ÷ Time
• Solution: 50 ÷ 2 = 25 miles per hour
Program Planning
The Importance of Planning
• Similar to a baking recipe or architectural blueprint
• Reduces errors
• Saves time in the long run
• More complex problems require more detailed plans
• Properly testing a plan before writing code is essential
Program Development Cycle
1. Analyze: Define the Problem
• Understand what the program should do
• Clarify what the output should be
• Identify the input data available
• Understand the relationship between input and output
Program Development Cycle
2. Design: Plan the Solution
• Create an algorithm (logical sequence of precise steps)
• Include every detail, even obvious steps
• Use programming tools to develop logic plan
• Test the algorithm with representative data
Program Development Cycle
3. Choose the Interface
• Select objects (text boxes, buttons, etc.)
• Determine how input will be obtained
• Decide how output will be displayed
• Create appropriate controls for user interaction
Program Development Cycle
4. Code: Translate Algorithm to Programming
Language
• Write the program using the chosen language (e.g.,
Visual Basic)
• Follow the algorithm developed in step 2
• Apply knowledge of programming language syntax
Program Development Cycle
5. Test and Debug
• Testing: Finding errors (bugs) in the program
• Debugging: Correcting those errors
• Different types of errors:
• Syntax errors (caught by the compiler)
• Runtime errors (appear during execution)
• Logical errors (program runs but produces incorrect results)
Program Development Cycle
6. Complete Documentation
• Organize all material describing the program
• Internal documentation: Comments within the code
• External documentation:
• User manuals
• Online help
• Program descriptions
• Flowcharts, pseudo code, and hierarchy charts
• Should occur throughout development, not just at the
end
Programming Tools
Three Main Tools
1.Flowcharts
2.Pseudo code
3.Hierarchy charts
Flowcharts
Definition and Purpose
• Visual representation of an algorithm using standardized geometric symbols
• Symbols are connected by arrows (flow lines) showing progression
• Flows from top to bottom of page