Design exercises
The biggest challenge that many programming students have with learning to program is learning to think like a machine. The biggest hurdle many programming students have with learning to think like a machine is learning to think in sequential steps. As with anything else in life, the key to learning to think algorithmically is practice, practice, practice!
The quadradic equation
To begin, let’s assume that we must design a program that can take three inputs and must output the results for the following equation:
Before continuing, try taking a moment to lay out the steps of how the program should work and the designs.
Design logic
The first step in designing this program is working out the steps that the program would need to follow. Since this is a math equation, we can apply rules that are commonly used in math to write the program. Therefore, the steps that can be used are as follows:
- Get the inputs for a, b, and c.
- Compute...