Fill This Form To Receive Instant Help
Homework answers / question archive / UD Page view ?" Read aloud Draw D Highlight Erase 6 True / False Questions 1
UD Page view ?" Read aloud Draw D Highlight Erase 6 True / False Questions 1. All implementations of compiled programming languages must use a compiler. a. True b. False 2. All implementations of interpreted programming languages must use an interpreter. a. True b. False 3. All programming languages require a run-time stack for allocation of local variables. a. True b. False 4. All programming languages require a heap for allocation of dynamic variables. a. True b. False 5. Programming languages with early binding times generally allow more efficient run-time implementations. a. True b. False 6. Programming languages with late binding times generally allow more flexible run-time implementations. a. True b. False Multiple Choice 7. The written form of the expressions, statements, and program units of a programming language. a. b. semantics grammar syntax BNF C. d. 8. The meaning of the expressions, statements, and program units of a programming language. a. b. C. d. semantics grammar syntax BNF D Page view A Read aloud V Draw Highlight Erase o 9 61 9. The set of structural rules that describe how to form sentences from the language's alphabet. a. b. semantics grammar syntax BNF C. d. 10. A notation technique for context-free grammars, often used to describe the syntax of programming languages. a. b. semantics grammar syntax BNF C. d. 11. The class of programming languages that are characterized by early binding times that enables efficient translation to machine language. a. b. C. 12. compiled programming language compiler interpreted programming language d. interpreter The class of programming languages that are characterized by late binding times that enables flexible program constructs. a. compiled programming language b. compiler C. interpreted programming language d. interpreter 13. A program that translates source code to machine language (or other low-level code). a. b. compiled programming language compiler interpreted programming language interpreter C. d. 14. A program that directly executes source code taking inputs and producing outputs. a. b. compiled programming language compiler interpreted programming language interpreter C. d. Grammars Consider the following grammar, which is from Example 3.4 in the text. = → A B C + | | + ( ) | And, the leftmost derivation in that grammar for the statement A = A * B + A * C. The first two steps in the leftmost derivation are: 1. - = → A = 2. 15. What is the 3rd step in the leftmost derivation? a. - A = b. Kassign> - A = C. A = * d. - A = 16. What is the 4th step in the leftmost derivation? a. A = + b. + A = * c. st A = d. - A = ( ) 17. What is the last step in the leftmost derivation? a. → A = * + * b. A = ( ) + ( ) C. A = * + * d. A = A * B + A * C - + D Page view A Read aloud y Draw Highlight © Erase et Consider the following grammar: + ac → a la 1 b C 18. Which of the following English statements describes the above language? a. Exactly one 'a' followed by any number of 'b's followed by any number of 'a's followed by any number of 'c's followed by exactly one 'c'. b. Exactly one 'a' followed by at least one 'b' followed by at least one 'a' followed by at least one 'c'. C. Exactly one 'a' followed by at least one 'b' followed by at least one 'a' followed by exactly two 'c's. d. Exactly one 'a' followed by exactly one 'b' followed by at least one 'a' followed by exactly two 'C's. 19. Which of the following are sentences generated by the grammar? a. abacc b. aabbaacc c. abbbaaacccc d. abbbaaacc Subprograms There are five (5) methods by which parameters may be transmitted to / from subprograms and three (3) semantic models - in mode, out mode, and in-out mode. We only looked in detail at four (4) of these methods: pass-by-value, pass-by-result, pass-by-value-result, and pass-by-reference. Circle the appropriate answer. 20. What is the semantic model for pass-by-value? a. in mode b. out mode c. in-out mode 21. What is the semantic model for pass-by-result? a. in mode b. out mode c. in-out mode 22. What is the semantic model for pass-by-value-result? a. in mode b. out mode c. in-out mode 23. What is the semantic model for pass-by-reference? a. in mode b. out mode C. in-out mode 24. The address of the actual argument is copied into the formal parameter when the subprogram is called and references to the formal parameter are via this address best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result C. pass-by-value-result d. pass-by-reference 25. The value of the formal parameter is copied into the actual argument when the subprogram returns best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 26. The value of the actual argument is copied into the formal parameter when the subprogram is called best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 27. The value of the actual argument is copied into the formal parameter when the subprogram is called and the value of the formal parameter is copied into the actual argument when the subprograms returns best describes which of the four (4) parameter passing methods? UD Page view ?" Read aloud Draw D Highlight Erase 6 True / False Questions 1. All implementations of compiled programming languages must use a compiler. a. True b. False 2. All implementations of interpreted programming languages must use an interpreter. a. True b. False 3. All programming languages require a run-time stack for allocation of local variables. a. True b. False 4. All programming languages require a heap for allocation of dynamic variables. a. True b. False 5. Programming languages with early binding times generally allow more efficient run-time implementations. a. True b. False 6. Programming languages with late binding times generally allow more flexible run-time implementations. a. True b. False Multiple Choice 7. The written form of the expressions, statements, and program units of a programming language. a. b. semantics grammar syntax BNF C. d. 8. The meaning of the expressions, statements, and program units of a programming language. a. b. C. d. semantics grammar syntax BNF D Page view A Read aloud V Draw Highlight Erase o 9 61 9. The set of structural rules that describe how to form sentences from the language's alphabet. a. b. semantics grammar syntax BNF C. d. 10. A notation technique for context-free grammars, often used to describe the syntax of programming languages. a. b. semantics grammar syntax BNF C. d. 11. The class of programming languages that are characterized by early binding times that enables efficient translation to machine language. a. b. C. 12. compiled programming language compiler interpreted programming language d. interpreter The class of programming languages that are characterized by late binding times that enables flexible program constructs. a. compiled programming language b. compiler C. interpreted programming language d. interpreter 13. A program that translates source code to machine language (or other low-level code). a. b. compiled programming language compiler interpreted programming language interpreter C. d. 14. A program that directly executes source code taking inputs and producing outputs. a. b. compiled programming language compiler interpreted programming language interpreter C. d. Grammars Consider the following grammar, which is from Example 3.4 in the text. = → A B C + | | + ( ) | And, the leftmost derivation in that grammar for the statement A = A * B + A * C. The first two steps in the leftmost derivation are: 1. - = → A = 2. 15. What is the 3rd step in the leftmost derivation? a. - A = b. Kassign> - A = C. A = * d. - A = 16. What is the 4th step in the leftmost derivation? a. A = + b. + A = * c. st A = d. - A = ( ) 17. What is the last step in the leftmost derivation? a. → A = * + * b. A = ( ) + ( ) C. A = * + * d. A = A * B + A * C - + D Page view A Read aloud y Draw Highlight © Erase et Consider the following grammar: + ac → a la 1 b C 18. Which of the following English statements describes the above language? a. Exactly one 'a' followed by any number of 'b's followed by any number of 'a's followed by any number of 'c's followed by exactly one 'c'. b. Exactly one 'a' followed by at least one 'b' followed by at least one 'a' followed by at least one 'c'. C. Exactly one 'a' followed by at least one 'b' followed by at least one 'a' followed by exactly two 'c's. d. Exactly one 'a' followed by exactly one 'b' followed by at least one 'a' followed by exactly two 'C's. 19. Which of the following are sentences generated by the grammar? a. abacc b. aabbaacc c. abbbaaacccc d. abbbaaacc Subprograms There are five (5) methods by which parameters may be transmitted to / from subprograms and three (3) semantic models - in mode, out mode, and in-out mode. We only looked in detail at four (4) of these methods: pass-by-value, pass-by-result, pass-by-value-result, and pass-by-reference. Circle the appropriate answer. 20. What is the semantic model for pass-by-value? a. in mode b. out mode c. in-out mode 21. What is the semantic model for pass-by-result? a. in mode b. out mode c. in-out mode 22. What is the semantic model for pass-by-value-result? a. in mode b. out mode c. in-out mode 23. What is the semantic model for pass-by-reference? a. in mode b. out mode C. in-out mode 24. The address of the actual argument is copied into the formal parameter when the subprogram is called and references to the formal parameter are via this address best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result C. pass-by-value-result d. pass-by-reference 25. The value of the formal parameter is copied into the actual argument when the subprogram returns best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 26. The value of the actual argument is copied into the formal parameter when the subprogram is called best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 27. The value of the actual argument is copied into the formal parameter when the subprogram is called and the value of the formal parameter is copied into the actual argument when the subprograms returns best describes which of the four (4) parameter passing methods? 20. What is the semantic model for pass-by-value? a. in mode b. out mode c. in-out mode 21. What is the semantic model for pass-by-result? a. in mode b. out mode C. in-out mode 22. What is the semantic model for pass-by-value-result? a. in mode b. out mode c. in-out mode 23. What is the semantic model for pass-by-reference? a. in mode b. out mode c. in-out mode 24. The address of the actual argument is copied into the formal parameter when the subprogram is called and references to the formal parameter are via this address best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result C. pass-by-value-result d. pass-by-reference 25. The value of the formal parameter is copied into the actual argument when the subprogram returns best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 26. The value of the actual argument is copied into the formal parameter when the subprogram is called best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference 27. The value of the actual argument is copied into the formal parameter when the subprogram is called and the value of the formal parameter is copied into the actual argument when the subprograms returns best describes which of the four (4) parameter passing methods? a. pass-by-value b. pass-by-result c. pass-by-value-result d. pass-by-reference LD Page view Read aloud Draw Highlight V Erase I m Consider the following program written in Ada syntax: procedure Main is X : Integer := 0; procedure Sub1 (A : in out Integer) is begin -- of Subl A: = A + 4; Put (X); Put (A); end Subl; begin of Main Subl (X); Put (X); end Main; This output three (3) values: X (from within Sub1), A (from within Sub1), and X (from Main) (in that order). 28. What are the three values printed assuming that A is pass-by-reference? a. X (from within Sub1) : b. A (from within Sub1): C. X (from Main) : 29. What are the three values printed assuming that A is pass-by-value-result? a. X (from within Sub1) : b. A (from within Sub1) : C. X (from Main) : 30. In this case, Ada guarantees which parameter passing method will be used (since the parameter is an integer type). Which one will be used? a. pass-by-value-result b. pass-by-reference age view Read aloud » Subprogram Implementation Consider the following program defined using Ada syntax: procedure Main is X : Integer; procedure Bigsub is A, B, C : Integer; procedure Subi (X : Integer) is B, E: Integer; procedure Sub2 is C: Integer; begin -- of Sub2 Sub3; 1 E := B + C; end Sub2; begin of Sub1 Sub2; 2 A := X + E; end Subl; procedure Sub3 is A, D: Integer; begin -- of Sub3 3 D := B + C; end Sub3; begin -- of Bigsub Subi (7); end Bigsub; begin -- of Main Bigsub; end Main; File | C:/Users/ahmed/Downloads/CSCI%203415%20Final%20Spring%202021.pdf *" Sign in o + {D Page view A Read aloud V Draw Highlight 2 Erase Q 3 Name: 34. Fill in the following table with the details for the activation record for Subl. Assume that all pointers and integers are four (4) bytes (32 bits) long. Consider #1 as the bottom of the activation record. Note that you may not need all of the rows. Offset Field Description 7 6 5 4 3 2 1 2 - + CD Page view | A Read aloud Draw Highlight Erase @ 19 Name: 35. Match each language with its corresponding characteristics (11 points). Go Language Answer Description (a-k) Ada a. A programming language that uses source code indentation to define the block structure of a program. ? b. A programming language that was created for developing the Unix operating system and still widely used for system programming. C++ c. An early interpreted functional programming language still extensively used in Artificial Intelligence. Cobol d. The first high-level programming language and still widely used for much scientific programming. Fortran e. A programming language designed to be 'safe' and portable, although its most common implementation was originally the focus of many security concerns. Go f. A language with an ownership model that guarantees memory-safety and thread safety thereby eliminating many classes of bugs at compile time. Java g. An object-oriented extension of the C programming language. Julia h. A language designed at Google to improve programming productivity in the era of multicore, networked machines, and large codebases. Lisp i. The largest programming language development effort to date originally funded by the US government. Python j. Still extensively used for business data processing and has an estimated 275 billion lines of installed code. Rust k. A high-level, high-performance, dynamic programming language that is well-suited to numerical analysis and data science. File users/ahmed/Downloads/CSCI%205415%20Final%20Spring%202021.pat 24 = Sign in + D Page view A Read aloud Draw Highlight Erase o procedure Bigsub is A, B, C : Integer; procedure Subi (X : Integer) is B, E: Integer; procedure Sub2 is C: Integer; begin -- of Sub2 Sub3; 1 E := B + C; end Sub2; begin -- of Subi Sub2; 2 A: = X + E;