Monday, March 4, 2013

Concepts of Programming Languages ---- Chapter 1 Preliminaries

Concepts of Programming Languages ---- Chapter 1 Preliminaries

Name : Fandy Limardi
NIM : 1601210713
Lecture : Tri Djoko Wahjono, Ir., M.Sc. (D0206)
Assignment : Concept of programming languages ---- chapter 1

Chapter 1
Review question
1.      Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language?
Answer  :  
-          Increased capacity to express ideas
-          Improved background for choosing the appropriate languages
-          Increased ability to learn new languages
-          Better understanding of the significance of implementation
-          Better use of languages that are already known
-          Overall advancement of computing

2.      What programming language has dominated scientific computing over the past 50 years?
Answer  : Fortran

3.      What programming language has dominated business applications over the past 50 years?
Answer : COBOL

4.      What programming language has dominated artificial intelligence over the past 50 years?
Answer : LISP

5.      In what language is most of UNIX written?
Answer : C

6.      What is one example of a lack of orthogonality in the design of C?
Answer :  under the following rules and exceptions in C, C has two kind of structured data types, arrays and records (struct), records can be returned from functions but arrays cannot. A member if a structure can be any data type except void or structure of the same type. An array element can be any data type except void or a function. Parameters are passed by value, unless they are arrays.
7.      What language used orthogonality as a primary design criterion?
Answer :  ALGOL 68

8.      What does it mean for a program to be reliable?
Answer : A program is said to be reliable if it performs to its specifications under all conditions.

9.      Why is type checking the parameters of a subprogram important?
Answer : Because run-time type checking is expensive ,compile-time type checking is more desirable. Furthermore, the earlier errors in programs are detected, the less expensive it is to make the required repairs.
10.  What is aliasing?
Answer : aliasing is having two or more distinct names that can be used to access the same memory cell.

11.  What is exception handling?
Answer : The ability of a program to intercept run-time errors (as well as other unusual conditions detectable by the program), take corrective measures, and then continue is an obvious aid to reliability.

Problem Set
1.      Who is said to be the first programmer in human history?
Answer : Ada Lovelace

2.      What are the disadvantages of multiple programming languages ?
Answer : Lack of standards and the programmer have to know multiple programming
languages

3.      In what way do the languages for scientific applications differ from the languages for business applications? Support your view.
Answer : The scientific applications of that time used relatively simple data structures, but required large numbers of floating-point arithmetic computations. The most common data structures were arrays and matrices, the most common control structures were counting loops and selections. The languages of business applications are characterized by facilities for producing elaborate reports, precise ways of describing and storing decimal numbers and character data and the ability to specify decimal arithmetic operations

4.      In what way do the languages for artificial intelligence differ from the languages for web software? Support your view.
Answer : Artificial intelligence is characterized by the use of symbolic rather than numeric computations. Symbolic computation means that symbols, consisting of names rather than numbers, are manipulated. It is more conveniently done with linked lists of data rather than arrays. Web software is supported by an eclectic collection of languages, ranging from markup languages, such as HTML, which is not a programming language, to general-purpose programming languages, such as Java. Code is often in the form of a scripting language, such as JavaScript or PHP

5.      Java uses a semicolon to mark the end of all statements. What are the advantages for and against this design?
Answer : The advantages is it will make the system to determine which group to be call and is being ended. In other meaning, a semicolon always terminates a statement. The argument against this design is that you require a semicolon for every statement

6.      Most languages use functions and subroutines. What are the pros and cons of this design decision?
Answer : The pros of this design is easier to use. In other meaning, function and subroutines make some statements to be 1 function and it can be use for many times with this function . The cons of this design is function can get annoying for some commonly-used operations. For example, math function could be represented with just functions like plus(), minus(), and divide() à total = add(a, add(b, add(c, add(d ,e) ) ) ).

7.      Make a comparative study of the cost of software and hardware
Answer : In previous times, the cost of hardware was higher than that of software, but
The cost of software is higher than the hardware now.

8.      Name some languages which use preprocessor directives and some which don’t. What are the advantages and disadvantages of preprocessor directives?
Answer : C and  C++ use preprocessor directives. Java doesn’t use preprocessor directives. The advantage by using preprocessor takes no memory. The disadvantages by using preprocessor are name not be seen by debugger (only replacement text) and haven’t specific data type

2 comments:

  1. hi you have a great blog and i am also a blogger

    visit my blog at:
    http://comp1234.tk/
    http://solvedprograms.blogspot.in/p/welcome.html

    ReplyDelete
  2. Really your blog is great.If anybody can know about foreign language it will be very for his or her future life.The languages of business applications are characterized by facilities for producing elaborate reports, precise ways of describing and storing decimal numbers and character data and the ability to specify decimal arithmetic operations.

    online language learning

    ReplyDelete