1) If an assembler language uses one basic add instruction for register to register, memory to register, register to memory, and memory to memory, then the author would cite this as an example of orthogonality.
2) A variable declared in a function is an example of a stack-dynamic variable in c++.
3) The binding of a value to a variable is most frequently done statically.
4) The binding of a value to a variable must occur at execution time, that is, the only time a value can be assigned to a variable is after program execution begins.
5) Plankalkul supported a single bit type.
6) Some operations in a programming language may be software simulated as opposed to being implemented as a hardware instruction
7 Syntax analysis refers to grammar checking.
8. One of the chief architects of Fortran was also instrumental in the specification of the Algol-60 programming language.
9. Is special word are key words as opposed to being reserved, the readability is improved.
10. Because of the desire to produce the most efficient code, the designers of FORTRAN included language features that could easily be implemented on the underlying hardware of the IBM computers available in the 1950s.
11. Process abstraction is best illustrated by procedures and functions.
12. The desire for easy use, quick turnaround, and free and private access led to time-shared version of BASIC.
13. A pure interpreter frequently leaves a program in its source form or a form that allows for easy recovery of the source.
14. Two variables cannot share the same memory location.
15. The binding of a type to a variable in compiled language is done statically.
17 In c++ the scope of a variable is totally determined by where it is declared.
18 Value cannot be assigned to variables statically in compiled languages.
19. In c++ n explicitly heap dynamic variable technically has no scope since it is not declared.
20 The three hallmarks of object-oriented languages are the notion of data abstraction, process abstraction, and inheritance.
Part 2. Answer the following matching questions from any of the answers below. Any answer may be used any number of times.
1. A translator whose target machine is different from the one on which the translator executes.
2. A basic program entity— a smallest syntactic unit.
3. A program that can be thought of as recognizing the valid statements in a language.
4. A programming language designed, in part, to implement operating systems.
5. Variables created when their declarations are reached during program execution.
6. A variable whose storage is allocated when assigned to
7. A language that is often implemented using a hybrid interpreter.
8. A programming language that tried to combine aspects of COBOL and FORTRAN in an attempt to be the “one programming language.”
a) for each of the variables declared or or created in the code, indicate whether that variable
is static, stack-dynamic, explicitly heap dynamic or implicitly heap dynamic.
b) display the output of the above program
During the execution of allocate, as the program is written, i )How do the storage for ptr and myptr compare?
ii) How does the lifetime of ptr compare with the lifetime of myptr?
iii) How do the value of ptr and myptr compare?
iv) The scope?
e) Given that the program above is executed, what would be the lifetime of the object created through operator new in allocate? Be specific as to when that object ceases to exist.
f) Given that the program above is executed, what would be the lifetime of the variable ptr in block b
What is the lifetime of the object that ptr points to in block b?
g) What is the lifetime of the two variables created in block A?