NoAI/GPT/BARD.
1.Assumethefollowing Ada program was compiled and executed.
procedure Main is
X: Integer;
procedure Sub1 is
begin — of Sub1
Put(X);
end;
procedure
Sub2
is
X: Integer;
begin — of Sub2
X := 10;
Sub1;
end;
begin — of Main
X := 5;
Sub2
end;
a) Using static scoping rules, what is the value of X is printed in procedure Sub1?
b) Under dynamic-scoping rules, what value of X is printed in procedure Sub1?
2. There are five different types of arrays discussed in class: static, fixed stack-dynamic, fixed heap-dynamic, and heap-dynamic. Identify the categories of arrays at positions 1, 2, 3, and 4
3. Given all the languages that you know, produce a list of data types in these languages.
4. What are the advantages of user-defined enumeration types?
5. List two design issues for arrays.
6. What is the structure of an associative array?
7. List one aspect that record and union are the same and one aspect that they are different.
8. Are the tuples of Python mutable?
9. Java is a static-typed language. What does “static-typed language” mean?
10. Compared with C, Java is a strong-typed language. What does “strong-typed language” mean?
11. What is a compatible type?
12. What is name type equivalence?
13. How do you evaluate a programming language by its data types?