Answer:

To the source program, where the change is easy to make. The changed source program is then translated into a new executable program.

Program Translation

Here is a picture that shows what usually happens with programs written in "C" (Java is different; it will be discussed in the next chapter.)

Translating a source program

Here is a review of what goes on:

  1. The source file is created using a text editor.
    • It contains instructions in a high level language.
    • It contains bytes that hold characters.
  2. The source file is kept on the hard disk.
  3. The source file can not be run by the processor.
  4. A translator (compiler) program can translate the source file into an executable file.
    • The source file remains unchanged; a new executable file is created.
    • A translator is used for programs written in a specific high level language (like "C") and a specific processor type (like "Pentium"), and only runs under a specific operating system (like "Windows".)
  5. The executable file is also kept on hard disk.
  6. To run the program, the operating system is told to copy the executable file into main memory and to start it running.

The above is what goes on with most languages: Ada, Pascal, C, C++, FORTRAN and others. Java adds a few more steps, which will be discussed in the next chapter.

QUESTION 10:

A source program has been written in the "C" language. The file has been copied onto the hard disk of a Pentium-based computer and onto the hard disk of an Apple Macintosh. What must now be done so that the program can execute on both computers?