Thus to produce an effective computer program it is

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: irmware. Chapter 11 Planning the Computer Program In Chapter 10, computer software has been described as a set of computer programs. We also saw in Chapter 10 that before writing a program for a software, one must first plan the program. That is, to produce a correct and effective computer program, one must first plan the logic (the various steps) of the program. If one attempts to plan the logic and write the program at the same time, he/she will likely become so involved with the required instruction formats that program logic will suffer. Hence, before we learn how to write a program (next chapter), we will first learn how to plan the logic of a computer program in this chapter. PURPOSE OF PROGRAM PLANNING Suppose you are asked by your teacher to solve an arithmetic problem and you are not familiar with the steps involved in solving that problem. In such a situation, you will not be able to solve the problem. The same principle applies to writing computer programs also. A programmer cannot write the instructions to be followed by a computer unless the programmer knows how to solve the problem manually. Suppose you know the steps to be followed for solving the given problem but while solving the problem, you forget to apply some of the steps or you apply the calculation steps in the wrong sequence. Obviously, you will get a wrong answer. Similarly, while writing a computer program, if the programmer leaves out some of the instructions for the computer or writes the instructions in the wrong sequence, then the computer will calculate a wrong answer. Thus, to produce an effective computer program, it is necessary that the programmer write each and every instruction in the proper sequence. However, the instruction sequence (logic) of a computer program can be very complex. Hence, in order to ensure that the program instructions are appropriate for the problem and are in the correct sequence, programs must be planned before they are written. ALGORITHM What is an Algorithm?...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online