Professional Documents
Culture Documents
Fransiskus Yogi Candra - 21412747 - Bi - Chapter 12
Fransiskus Yogi Candra - 21412747 - Bi - Chapter 12
The second step in the program development cycle is that of designing the
program. At this stage, the logic of the program should be put into a pictorial
form. That is, at this point the programmer must try to picture all the small
steps that are necessary to carry out the desired procedures. To do this, the
programmer often creates a flowchart, a diagram made up of geometrical
symbols that illustrates how the problem will be solved. At this stage, then, the
programmer would write a flow chart for the grade-calculating program
mentioned above. Although a flowchart is not the only method of designing a
program, it is still the most common
CODING FOR THE PROGRAM
The next step in the program development cycle is that of coding the program. This is
the actual writing of the program in a form the computer can understand. Any
appropriate computer language, like the ones discussed previously in this book, can be
used for coding the program. However, it is important to remember that some languages
are better and more efficient for writing programs in particular fields, as is FORTRAN
for math and science. After the program is written, it should be input into the computer.
Once it is in the computer, a printed copy called a listing can then be obtained. The
listing can help the programmer review the program for errors in input, typing, logic, etc.
Whether or not a listing is used, reviewing small parts of a program at this point-before
testing the entire program- may prove to be very helpful in creating a successful program
TESTING THE PROGRAM
The next step in the program development cycle is that of testing and debugging-
correcting or revising the entire program. During this stage of development, the
programmer looks for and corrects additional errors in the program not found during the
inputting stage. The testing of a program does not have to involve the use of all the data.
Instead, testing can be carried out with samples of data. For example, referring to the
grade program mentioned above, the testing of the program can be done with only three
or four instead of fifteen or twenty actual grades. If the program works well with a small
number of items, it usually works as successfully for a larger number of data items.
Furthermore, although only a small number of data are used, the testing procedure must
make sure that all instructions in the program are executed at least once, perhaps several
times. If this is done, the programmer can be sure that all parts of the program work
correctly.
DEVELOPING DOCUMENTATION FOR THE PROGRAM
After the program has been tested, the last step in the program development cycle should
be implemented. This is the development of documentation, detailed accounts which
explain and clarify the program. This type of document or book is generally called a
manual. Creating a manual is especially important for very long and complicated
programs The documentation should explain everything possible about the program
including how the program runs and what type of data is needed. For our sample grade
program, the documentation should explain such things as: whether letter or number
grades must be input, whether a person can calculate the average of a particular number
of grades; or whether he or she may specify the total number of grades to be input in the
program itself. Finally, a listing and a flowchart of the program could be included
FLOWCHARTS
As already stated, the second step in the program development cycle Involves designing
the logic of a program. This should be done before writ ng the program by creating a
flowchart or by using another method of program design. The flowchart, also called the
program flowchart or block diagram, is he most common method of outlining the logic
of a program. The flowchart is really a diagram com posed of symbols, directional lines,
and information about how the computer will be used to solve a particular problem. The
Flowchart illustrates the steps required for solving the problem. It shows what should be
done, not how it should be accomplished. It should not only present the logical elements
of a program, but also provide a detailed plan to aid in writing the program. The
flowchart also ought to serve as a means of communication between different
programmers
FLOWCHART SYMBOLS
the flowchart is composed of symbols which refer to specific functions of the computer.
There should be an explanatory note in each symbol.
These notes help to clarify which process should take place at each point in the entire
procedure. The flowlines should indicate the direction f
the program; that is, they should indicate the order in which the steps will be executed.
The normal direction of a flow should be from left to
ight and top to bottom The flowchart symbols which indicate the different computer
functions are really geometrical shapes. The most
commonly used symbols are the oval, the parallelogram, the rectangle, and the diamond.
A parallelogram should be used to represent either
input or output. A rectangle is used to indicate that some kind of processing is taking
place, such as adding numbers or moving data from
secondary to main storage.
Other symbols may also be used in program flowcharts. These include :
= equal to
≠ not equal to
> Grater than
< less than
>= greater than or equal to
<= less than or equal to
Y Yes
N No
DRAWING FLOWCHARTS
A program flowchart must be simple and easy to read.
Flowcharts may be drawn in several ways, including by
hand, or with a template. A template is a piece of plastic
which contains the cutouts for all the flowcharting symbols
(see illustration 12.3). The template can be used to trace the
sym bols neatly and clearly. In addition, some flowcharts
can even be drawn by computers
BREAKING DOWN THE STEPS OF A COMMON
ACTION IN ORDER TO SEE HOW FLOWCHARTS
ARE PLANNED
As stated, before a programmer makes a flowchart, he
or she must analyze a problem and break the problem
down into small and logical steps. Once the problem
has been broken down into its different parts, the
programmer can draw a flowchart, and then use the
flowchart to write a program. In order to understand
how a programmer plans a program and writes a
flowchart
FLOWCHART FOR A COMPUTER TASK: AVERAGING
NUMBERS