Week One Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

WEEK ONE ASSIGNMENT.

COURSE: PRINCIPLES OF PROGRAMMING LANGUAGES

COURSE CODE: CSC 324

NAME: MUCHUKA CATHERINE NABIRIE

REG NO: COM/0036/20

QUESTION 1
It is useful for a programmer to have some background in language design because;
 It 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

QUESTION 2
How can knowledge of programming language characteristics benefit the whole computing
community?
It will provide insight on what functionally that certain languages provide works well, and what
doesn't work well. this also will allow programmers design languages that contain the great
characteristics of languages.
Also, the knowledge of the characteristics of the programming languages makes one a better
programmer. If the programmers know the implementation details of some construct, they can
understand for what tasks need to be done for efficiency purposes.

QUESTION 3
What programming language has dominated scientific computing over the past 50 years?
Fortran

QUESTION 4
What programming language has dominated business applications over the past 50 years?
Cobol
QUESTION 5
What programming language has dominated artificial intelligence over the past 50 years?
Lisp (List Processing) is one of programming language with a long history and a distinctive,
fully parenthesized polish prefix notation.

QUESTION 6
In what language is most of UNIX written?
C Language

QUESTION 7
What is the disadvantage of having too many features in a language?
The readability and understandably of a language is decreased as a reader may not have
knowledge of all features.
It tends to lead to knowing only a subset.

QUESTION 8
How can user-defined operator be overloading harm the readability of a program?
This will sometimes lead to reduced readability. + can mean two different things in program.
If the operations are used in odd unintuitive ways.

QUESTION 9
What is one example of a lack of orthogonality in the design of C?
A member of a structure can be any data type (except void), or the structure of the same type.

QUESTION 10
What language used orthogonality as a primary design criterion?

Assembly Languages (ALGOL 68)


QUESTION 11
What primitive control statement is used to build more complicated control statements in
languages that lack them?

The selection statement plus GOTO is used to build more complicated control statements such as
FOR loop.

QUESTION 12
What construct of a programming language provides process abstraction?
Subprograms

QUESTION 13
What does it mean for a program to be reliable?

If it performs to its specifications under all conditions.

QUESTION 14
Why is type checking the parameters of a subprogram important?
Type checking is an important factor in language reliability because it’s testing for type errors in
a given program, either by the compiler or during the execution of a program. Type checking
the parameters of a subprogram would be necessary because a failure may lead to countless
program errors

QUESTION 15
What is aliasing?
Aliasing means having two or more distinct names that can be used to access the same memory
cell.

QUESTION 16
What is exception handling?
Exception handling is the ability of a program to intercept run-time errors and other unusual
conditions detectable by the program and take corrective measures then continue which is an
obvious aid to reliability.
QUESTION 17
Why is readability important to writability?
Because programs that are difficult to read will be difficult to be written or modified.
QUESTION 18.
How is the cost of compilers for a given language related to the design of that language?
Many run time checks will prohibit fast code execution. If optimization is used compiling will be
slower but execution will be faster.
QUESTION 19.
What have been the strongest influences on programming language design over the past 50
years?

The basic architecture of computers (von Neumann)

QUESTION 20.
What is the name of the category of programming languages whose structure is dictated by the
von Neumann computer architecture?
Imperative Language
QUESTION 21.
What two programming language deficiencies were discovered as a result of the research in
software development in the 1970s?
Incompleteness of type checking and inadequacy of control statements
QUESTION 22.
What are the three fundamental features of an object-oriented programming language?
a) Encapsulation
b) Inheritance
c) Polymorphism
QUESTION 23.
What language was the first to support the three fundamental features of object-oriented
programming?

Smalltalk

QUESTION 24.
What is an example of two language design criteria that are in direct conflict with each other?
Reliability and cost of execution

QUESTION 25.
What are the three general methods of implementing a programming language?
a) Compilation
b) Pure Interpretation
c) Hybrid Implementation.

QUESTION 26.
Which produces faster program execution, a compiler or a pure interpreter?
Compiler

QUESTION 27.
What role does the symbol table play in a compiler?
The compiler converts each user –defined line into a machine-readable code then back to user
readable language. The symbol table shows the process and how the user-defined code in
translated to lexical and syntax analysis then is generated to semantics analysis and code
generation. The Symbol table basically shows the load module, linking, and loading process.

QUESTION 28.
What does a linker do?
It combines the object file with other machine code necessary to make a C++ program run
correctly. It takes your code an produces an executable file that can run

QUESTION 29.
Why is the von Neumann bottleneck important?
It limits the speed of a computer

QUESTION 30.
What are the advantages in implementing a language with a pure interpreter?
A pure interpreter is easier to build, the code becomes more independent, provides more security,
and they also provide stack trace information, which was not possible before interpreters.

You might also like