Selasa, 26 Maret 2013

Concepts of Programming Language - Chapter 2

Review Questions

1.In what year was Plankalkul designed? In what year was that design published?Designed by Konrad Zuse in 1945. Published in 1972.


2.Mention an interesting feature of Zuse's programs.An interesting feature of Zuse’s programs was the inclusion of mathematical expressions showing the current relationships between program variables. These expressions stated what would be true during execution at the points in the code where they appeared.


3.What does Plankalkul mean?
Plankalkul means program calculus.


5.What is the number of bits in a single word of the UNIVAC I's memory? How are the bits grouped?
The words of the UNIVAC I’s memory had 72 bits, grouped as 12 six-bit bytes. 


7.Who developed the Speedcoding system for the IBM 701?
 John Backus.


10.What was the most significant feature added to Fortran I to get Fortran II?
 Independent compilation of subroutines


12. Which version of Fortran was the first to have any sort of dynamic variables?
FORTRAN 4


13. Which version of Fortran was the first to have character string handling?
FORTRAN 77


16.In what way are Scheme and Common LISP opposites of each other?
  Scheme lacks on portability but LISP doesn’t. That’s why they are different.


18.What two preofessional organizations together designed ALGOL 60?
 Association for Computing Machinery (ACM) and GAMM


19. What was the goal for developing for developing C?
  to provide a language in which programs could be organized as they could be organized in SIMULA 67—that is, with classes and inheritance.


21. What language was designed to describe the syntax of ALGOL 60?
   BNF (Backus-Naur form).


22. On what language was COBOL based?
FLOW-MATIC language.


23. In what year did the COBOL design process begin?
 1959.


26. Which data type does the original BASIC language support?
Floating-point


28. PL/I was designed to replace what two languages?
Fortran and COBOL


37. What are the two kinds of statements that populate a Prolog database?
Facts and Rules




Problem Sets


3.Write a short history of the Fortran 0, Fortran I, Fortran II, and Fortran IV systems.

Fortran 0 was modified during the implementation period, which
began in January 1955 and continued until the release of the compiler in April
1957. The implemented language, which we call Fortran I, is described in the
first Fortran Programmer’s Reference Manual.

FORTRAN I: The first FORTRAN compiler was a milestone in the history of computing, at that time computers had very small memories (on the order of 15KB, it was common then to count memory capacities in bits), they were slow and had very primitive operating systems (if they had them at all). At those days it seemed that the only practical way is to program in assembly language.
FORTRAN II: FORTRAN II (1958) was a significant improvement, it added the capability for separate compilation of program modules, assembly language modules could also be ‘linked loaded’ with FORTRAN modules 


6. Make an educated guess as to the most common syntax error in C programs.

-using instead of ==
-scanf() errors (Forgetting to put an ampersand (&) on arguments, Using the wrong format for operand)
-Loop errors
-forget to put semicolon(;) in the end of a statement


7.LISP began as a pure functional language but gradually acquired more and more imperative features. Why?

LISP acquired more and more imperative feature because repetitive processes can be specified with recursive function calls, making iteration (loops) unnecessary. That basic concept of functional programming makes it significantly different from programming in an imperative language.

13.What is the primary reason why C became more widely used than Fortran? 

The primary reason why C became more widely used than Fortran because Fortran will never be much faster than C, moreover C is much more readable.

14. What are the arguments both for and against the idea of a typeless language?

 Typeless language allowing more flexibility but it also can create an ambiguity as to the contents of a variable

15.Describe the two levels of uses of operational semantics!

 There are. Some of them include database manipulation languages, such as SQL and perhaps some other kind of language like Visual Basic.

24.Why, in your opinion, do new scripting languages appear more frequently than new compiled languages?

 Because scripting languages usually are simpler and focused on specific applications.

25. Give a brief general description of the Java Scarlet.

Java servlet is server-side Java program modules that process and answer client requests and implement the servlet interface

Tidak ada komentar:

Posting Komentar