Dwight Watt - Newspaper Article #373 4/5/2017


Question: What is an algorithm?

Answer:

Algorithms are step by step directions to solve a problem.

When people are writing, or developing computer programs they will often use algorithms to design the program. The algorithm is a way to determine the steps needed to solve the problem we are developing a program to do.

When you develop the algorithm, you use ordinary English to figure out all the steps to solve the problem. For instance, an algorithm to determine gross pay may look like the following:

Input personís name
Input hours worked
Input pay rate
Calculate pay = hours worked times pay rate
Output personís name and pay

Obviously, that could get more complicated as we consider things like overtime pay, taxes and deductions. However, with this algorithm we can now go to the programming language we are going to use an write a program that includes those steps but written in a language the computer understands.

It always helps to design the computer program first (whether using algorithms, pseudocode (which is similar to an algorithm) or flowcharts. If you were going to build a building you should first draw out how the building will be whether in simple drawings or blue prints or your building may never stand when built.