for tasks a computer can do to solve a stated problem. All computer programs are a series of small steps. Even advanced computer simulations simply complete small steps and follow the rules the programmer set up to model a condition or process. Good programmers notice patterns in everything they do. They are good at writing expressions that describe a problem. They are great at logical thinking. They are good at finding relationships between things and making connections that are key to the solutions. Many programmers are also very musical. The ability to recognize and follow patterns in music can transfer to programming. Relentless Checkers Good programmers check, recheck, and double-check. It is easy to lose track of the fine points of a problem statement during the computational-thinking process. Programmers need to go back and verify that they actually solved the problem correctly and completely. They check the algorithm. They check each line of code. They check input. They check output. They verify that the problem presented was solved. An entire segment of computer science is dedicated to the design, develop- ment, and deployment of the best software possible. This sector is known as software quality assurance. Those working in this sector are involved with the project from the decomposition stage though the final testing. They check every aspect of the program to ensure an excellent product. Coding Conundrum This coding conundrum feature is your chance to check the results to identify an error in the process. Use computational thinking to find the mishap in the following example. Problem: Generate the first 10 natural numbers. Decompose: Natural numbers are the positive counting numbers: 1, 2, 3 1. Start at the first natural number. 2. Add one to the first natural number to get to the second. 3. Keep counting until the first 10 natural numbers are shown. Pattern: Each natural number is 1 more than the prior natural number. Abstract: Use n + 1 as the general notation for the next natural number where n is the current natural number. Algorithm: 1. Let n = 0. This is the first natural number. 2. Show the natural number. 3. Ask if we have 10 numbers? A. Yes, stop. B. No, Let n = n + 1. Go to step 2. Find the error in this computational thinking. Copyright Goodheart-Willcox Co., Inc. Chapter 1 Computational Thinking 19
Previous Page Next Page