0% found this document useful (0 votes)
5 views2 pages

Programming Languages Final Simulation

The document outlines the structure of a final exam for a programming languages course, consisting of explanation, drawing, fill-in-the-blank, and true/false questions. Key topics include referential transparency, pass-by-value vs pass-by-reference, runtime stack, activation records, and control flow graphs. The exam assesses understanding of programming concepts and language semantics as outlined in various chapters.

Uploaded by

82dn66qxff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Programming Languages Final Simulation

The document outlines the structure of a final exam for a programming languages course, consisting of explanation, drawing, fill-in-the-blank, and true/false questions. Key topics include referential transparency, pass-by-value vs pass-by-reference, runtime stack, activation records, and control flow graphs. The exam assesses understanding of programming concepts and language semantics as outlined in various chapters.

Uploaded by

82dn66qxff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming Languages - Final Exam

Simulation
A. Explanation Questions (2 Questions)
1. Explain the concept of Referential Transparency. Give an example.
(Chapter 7 – Final %70)

2. Describe the difference between pass-by-value and pass-by-reference.


(Chapter 9 – Final %70)

B. Drawing Questions (2 Questions)


3. Draw the runtime stack if the function call order is:
main → process() → compute() → print()
(Chapter 10 – Final %70)

4. For the following function, draw the activation record layout:


void sub(float total, int part) {
int list[5];
float sum;
}
(Chapter 10 – Final %70)

C. Fill in the Blanks (10 Questions)


5. Short-circuit evaluation is used with _________ and _________ operators. (Ch. 7)

6. The method of evaluating expressions without changing variable state is called


________. (Ch. 7)

7. In C, assigning a float to an int involves ________. (Ch. 7)

8. if-else and switch statements are types of ________ statements. (Ch. 8)

9. The runtime memory area for function calls is the ________. (Ch. 10)

10. Pass-by-________ allows a function to modify the caller’s variable. (Ch. 9)

11. A CFG defines the ________ of a programming language. (Ch. 3 – Vize %30)
12. { } in EBNF means zero or more ________. (Ch. 3 – Vize %30)

13. An activation record includes parameters and ________. (Ch. 10)

14. The operator == has ________ precedence than +. (Ch. 7)

D. True / False Questions (10 Questions)


15. Short-circuit evaluation always evaluates all conditions. (False, Ch. 7)

16. Pass-by-value allows the function to change the caller’s variable. (False, Ch. 9)

17. CFG defines the semantics of a language. (False, Ch. 3 – Vize %30)

18. [x] in EBNF means x occurs zero or one time. (True, Ch. 3 – Vize %30)

19. Pass-by-reference allows external variable modification. (True, Ch. 9)

20. Stack is FIFO (First In First Out) structure. (False, Ch. 10)

21. A function call always creates a new activation record. (True, Ch. 10)

22. else always binds to the farthest if. (False, Ch. 8)

23. All operators in C have the same precedence. (False, Ch. 7)

24. Assignment operators in C associate right to left. (True, Ch. 7)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy