7: Program Development
- Page ID
- 54207
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)
Writing or developing programs is easier when following a clear methodology. The main steps in the methodology are:
- Understand the Problem
- Create the Algorithm
- Implement the Program
- Test/Debug the Program
To help demonstrate this process in detail, these steps will be applied to a simple problem to calculate and display the period of a pendulum.
As additional examples are presented in later chapters, they will be explained and presented using this methodology.
- 7.1: Understand the Problem
- Before attempting to create a solution, it is important to understand the problem. Ensuring a complete understanding of the problem can help reduce errors. The first step is to understand what input is required and what information the program is expected to produce.
- 7.2: Create the Algorithm
- The algorithm is the name for the ordered sequence of steps involved in solving the problem. That sounds good, but it is a fancy way of saying that an algorithm is just a step-by-step procedure to solve a problem. Once the program is understood, the steps can be developed to solve that specific problem. There can be multiple correct solutions to a given problem.
- 7.4: Test/Debug the Program
- Once the program is written, testing should be performed to ensure that the program works. The testing will be based on the specific parameters of the program.