Sunday, March 3, 2013

Concepts of Programming Languages 10th Edition : Chapter 1

Created By : Robert W. Sebesta
Lecturer : Mr. Tri Djoko Wahjono, Ir. M.Sc
Answered by : Shirley Halim Ng
NIM : 1601233805
Class : 02PCT 

Review Questions
6. In What languages is most of UNIX written?
=> UNIX is an operating system that written almost entirely in C that made it relatively easy to port and move from one device to another device.
7. What is the disadvantages of having too many features in a languages?
=> The disadvantages of having too many features in a languages is reducing the limitation in software development.
9. What is one example of a lack of orthogonality in the design of C?
=> As examples of the lack of orthogonality in a high-level language, consider the following rules and exceptions in C. Although C has two kinds of structured data types, arrays and records (structs), records can be returned from functions but arrays cannot. A member of a structure can be any data type except void or a 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, in which case they are, in effect, passed by reference (because the
appearance of an array name without a subscript in a C program is interpreted to be the address of the array’s first element).
13. What does it means for a program to be reliable?
=> A program said to be reliable if it perform the specifications under all condition.
15. What is aliasing?
=> Aliasing is having two or more distinct names that can be used to access the same cell of memory.
16. What is exception handling?
=> 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.
17. Why is readability important to writability?
=> Because in the process of writing the program is needed to be reread the part of program again.
26. Which produces faster program execution, a compiler or a pure interpreter?
=> Compiler.
29. What is a hybrid implementation system?
=> Compilers and pure interpreters translate high-level language programs to an intermediate language designed to allow easy interpretation. This implementations are called Hybrid Implementation Systems.
30. What are the advantages of using Borland JBuilder? 
=> Borland JBuilder is a programming environment that provides an integrated compiler, editor, debugger, and file system for Java development, where all four are accessed through a graphical interface. JBuilder is a complex and powerful system for creating Java software.

Problem Set
2. Who is said to be the first programmer in human history?
=> Ada Lovelace is said to be the first programmer in human history. She was an English mathematician and a writer. Her notes on the engine include what is recognized as the first algorithm intended to be the process of machine. So she is considered to be the first programmer in the world.
3. What are the disadvantages of multiple programming languages?
=> The programmer needs to know a lot of syntax that usually different one another, it may cause the programmer get confused of this situation.
6. Which characteristic of programming languages do you think are the most important and why?
=> I think the most important of the characteristic of programming languages is SIMPLICITY because it includes all the criteria of the programming languages (READABILITY, WRITABILITY, and RELIABILITY).
7. Java uses a semicolon to mark the end of all statements. What are the advantages for and against this design?
=> Semicolon is used in Java programming languages to tell that it is one statement that computer have to execute one by one statement the program until it meets the semicolon.
10. Make a comparative study of the cost of software and hardware!
=> In earlier time, hardware cost is much higher than the software cost, but nowadays, there are many expensive cost hardware and actually nowadays, software cost is higher than the software cost.
15. Name some languages which use preprocessor directive and some which don’t. What are the advantage and disadvantages of preprocessor directive?
=>C and C++ programming languages use preprocessor directive while Java is not using preprocessor directive.
# Advantages: reduce compiling time, reduce program length and save time in calling a lot of function
# Disadvantages:  The disadvantage of the macro is the size of the program. The reason is, the pre-processor will replace all the macros in the program by its real definition prior to the compilation process of the program.



No comments:

Post a Comment