Devise a Plan Scientists call the plan an algorithm. An algorithm is a sequence m of instructions that can be used to solve a problem. Petrus Apianus’s plan was to build a surface with an object to cast a shadow. The position of the shadow would tell the time of day. Figure 2-3 shows a sundial. See how the Sun’s shadow lines up with the time of day. There are often several ways to solve a problem. Choosing which strategy is best often comes down to what has been learned by solving many problems. Here are some suggestions for strategies: • Guess and check. • Make an orderly list. • Eliminate possibilities that will not work. • Look for a pattern. • Draw a picture. • Solve a similar, but simpler, problem. • Use a model. Carry Out the Plan Once a plan is created, it must be carried out. This step is usually easier than devising the plan. After Petrus Apianus devised his plan to tell time with the Sun, the next step was to build the sundial. In the case of a computer-based solution, programmers write the code in this step. They take the algorithm and translate it into computer code. The computer needs an equation to be able to solve the problem. All that is needed to be successful is care, patience, and experience. Persist with the plan you have chosen. If it continues not to work, discard it, and devise another plan. This is how computer programming is done, even by professionals. Lucy Menshov/Shutterstock.com Figure 2-3. A sundial can be used to tell time based on the position of the Sun. Shown here, the time of day is 4 ’clock. Hands-On Example 2.1B Hands-On Example 2.1B Carry Out a Plan The sundial is an n ancient device. It is generally considered o the first device used to tell time. The earliest examples e of sundials date to around 1500 0 BC. As long as the Sun is shining, it is easy to tell time with h a sundial. 1 Consider the sundial shown. It is placed verticall ly on a wall. There is a rod with a looped end extending from r the decorative centerpiece. T Th e roman numerals VI (six) through XII (twelve) and I (o on e) through IV (four) appear from left to right. Ivan Sm mu k/Shutterstock.com Continued Copyright Goodheart-Willcox Co., Inc. 26 Introduction to Computer Science: Coding