08.01.2023 Views

Learn to Program with C_ Learn to Program using the Popular C Programming Language ( PDFDrive )

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.2.6 Document the Program

Chapter 1 ■ Elementary Programming Concepts

The final job is to complete the documentation of the program. So far, our documentation

includes the following:

• The statement of the problem.

• The algorithm for solving the problem.

• The program listing.

• Test data and the results produced by the program.

These are some of the items that make up the technical documentation of the program. This is

documentation that is useful to a programmer, perhaps for modifying the program at a later stage.

The other kind of documentation that must be written is user documentation. This enables

a nontechnical person to use the program without needing to know about the internal workings

of the program. Among other things, the user needs to know how to load the program in the

computer and how to use the various features of the program. If appropriate, the user will also

need to know how to handle unusual situations that may arise while the program is being used.

1.2.7 Maintain the Program

Except for things like class assignments, programs are normally meant to be used over a long

period of time. During this time, errors may be discovered that previously went unnoticed. Errors

may also surface because of conditions or data that never arose before. Whatever the reason, such

errors must be corrected.

But a program may need to be modified for other reasons. Perhaps the assumptions made when

the program was written have now changed due to changed company policy or even due to a change

in government regulations (e.g., changes in income tax rates). Perhaps the company is changing its

computer system and the program needs to be “migrated” to the new system. We say the program

must be “maintained.”

Whether or not this is easy to do depends a lot on how the original program was written.

If it was well-designed and properly documented, then the job of the maintenance programmer

would be made so much easier.

1.3 How a Computer Executes a Program

First, recall that a computer can execute a program written in machine language only. For the

computer to execute the instructions of such a program, those instructions must be loaded into

the computer’s memory (also called primary storage), like this:

memory

instruction 1

instruction 2

instruction 3

etc.

9

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!