It's about life

Chapter 1 Solution

Mr. Tri Djoko Assignment

Review Question

  1. The reasons are: increased capacity to express ideas, improved background for choosing appropriate languages; increased ability to learn new languages, better understanding of the significance of implementation, better use of languages that are already known, and overall advancement of computing.
    (answer no 1)
  2. FORTRAN has dominated scientific computing for the past 50 years.
    (answer no 3)
  3. Most of UNIX was written in the language C. In fact, C was created to write the UNIX operating system.
    (answer no 6)
  4. A disadvantage of having too many features is reduced readability. It also means that a
    programmer may not be familiar with all the features. This may lead to an abuse of some, disuse of others, and even an accidental use of an unknown feature.
    (answer no 7)
  5. An example of process abstraction is the use of a subprogram (a function, or method, or procedure, etc).
    (answer no 12)
  6. Aliasing is having two or more distinct names that can be used to reference the same memory cell.
    (answer no 15)
  7. The imperative or procedural category consists of languages whose design was dictated by the von Neumann architecture.
    (answer no 20)
  8. Data abstraction—the concept of a class, inheritance, and dynamic method binding—the concept of method polymorphism are the three fundamental features of an object- oriented language.
    (answer no 22)
  9. One example is reliability and cost of execution. For example a Java program is more
    reliable than a C program because all array accesses are checked that they are in
    range. However, the C program has a smaller cost of execution. Another example is readability and writability. Because of its large number of operators, an APL program can express a complex computation quite compactly. However, it can be quite difficult
    to read.
    (answer no 24)
  10. The three general implementation methods are;
  • (1) Compilation, the program is translated into machine code.
  • (2) Interpretation, no translation is used; the source code is the “executable” code. And,
  • (3) hybrid systems, when some translation takes place to an intermediate language and this intermediate language is interpreted.

    (answer no 25)

Problem set

  1. Some arguments for having a single language for all programming domains are: It
    would dramatically cut the costs of programming training and compiler purchase and maintenance; it would simplify programmer recruiting and justify the development of numerous language dependent software development aids.
    (answer no 3)
  2. Some arguments against having a single language for all programming domains are:
    The language would necessarily be huge and complex; compilers would be expensive
    and costly to maintain; the language would probably not be very good for any
    programming domain, either in compiler efficiency or in the efficiency of the code it generated.
    (answer no 4)
  3. Wordiness. In some languages, a great deal of text is required for
    even simple complete programs. For example, COBOL is a very wordy language. In
    Ada, programs require a lot of duplication of declarations. Wordiness is usually
    considered a disadvantage, because it slows program creation, takes more file space for the source programs, and can cause programs to be more difficult to read.
    (answer no 5)
  4. The argument for using the right brace to close all compounds is simplicity—a right
    brace always terminates a compound. The argument against it is that when you see a
    right brace in a program, the location of its matching left brace is not always obvious, in part because all multiple-statement control constructs end with a right brace.
    (answer no 7)
  5. One of the main arguments is that regardless of the cost of hardware, it is not free.
    Why write a program that executes slower than is necessary. Furthermore, the difference between a well-written efficient program and one that is poorly written can be a factor of two or three. In many other fields of endeavor, the difference between a good job and a poor job may be 10 or 20 percent. In programming, the difference is much greater.
    (answer no 10)
  6. The use of type declaration statements for simple scalar variables may have very little
    effect on the readability of programs. If a language has no type declarations at all, it may
    be an aid to readability, because regardless of where a variable is seen in the program
    text, its type can be determined without looking elsewhere. Unfortunately, most
    languages that allow implicitly declared variables also include explicit declarations. In a  program in such a language, the declaration of a variable must be found before the reader can determine the type of that variable when it is used in the program.
    (answer no 15)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


This entry was posted on March 5, 2013 by and tagged .
March 2013
« Jan   Apr »

Blog Stats

  • 10,673 hits
%d bloggers like this: