0% found this document useful (0 votes)
6 views6 pages

PPL MCQ

The document contains multiple-choice questions and fill-in-the-blank exercises related to programming concepts, including referencing environments, named constants, sub-programs, and parameter passing methods. It also provides correct answers for each question and fill-in-the-blank item. The content is intended for educational purposes at the Mother Teresa Institute of Science and Technology.
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)
6 views6 pages

PPL MCQ

The document contains multiple-choice questions and fill-in-the-blank exercises related to programming concepts, including referencing environments, named constants, sub-programs, and parameter passing methods. It also provides correct answers for each question and fill-in-the-blank item. The content is intended for educational purposes at the Mother Teresa Institute of Science and Technology.
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/ 6

MOTHER TERESA INSTITUTE OF SCIENCE AND TECHNOLOGY

Approved by AICTE,Govt. of Telangana ,Affiliated to JNTUH & SBTET,


Hyderabad RecognitionunderSection2(f)&12(B)oftheUGCAct,1956
SANKETIKANAGAR,KOTHURU(V),SATHUPALLY–507303,KHAMMAMDist.,TELANGANA
Phone:9494641251,EmailID:info@mistech.ac.in

Multiple Choice Questions:

1. What is a referencing environment? [ ]

A) The physical location of a program's files

B) The mapping of variable names to their values and memory locations

C) The set of instructions for compiling code

D) The graphical user interface of a programming language

2. What is a named constant? [ ]

A) A variable that can change its value at runtime

B) A variable whose value cannot be altered after it is assigned

C) A placeholder for user input

D) A function that returns a constant value

3.Which of the following is a primary benefit of using named constants? [ ]

A) Improved readability and maintainability of code

B) Increased execution speed

C) Reduced memory usage

D) Automatic type inference

4. In which of the following scenarios would a referencing environment be particularly useful? [ ]

A) When declaring variables

B) When managing multiple functions or sub-programs

C) When executing a single line of code

D) When defining data types

5. What happens if you try to change the value of a named constant in a program? [ ]

A) The program runs normally

B) A compilation error occurs

C) The constant is updated


D) The program will crash

6. What is the primary characteristic of interpretation? [ ]

A) Translates the entire source code before execution

B) Executes code line-by-line at runtime

C) Converts high-level code to machine code

D) Requires a virtual machine to run

7. Which of the following languages primarily uses compilation? [ ]

A) Python

B) Ruby

C) C++

D) JavaScript

8. What does JIT stand for in programming language implementation? [ ]

A) Just-In-Time

B) Java Interpreted Type

C) Joint Instruction Translation

D) Just-In-Time Translation

9. What is a major benefit of hybrid approaches like those used in Java? [ ]

A) They are always faster than pure compilation

B) They balance performance and flexibility

C) They require no additional runtime environment

D) They eliminate the need for debugging

10. What is the purpose of transpilation? [ ]

A) To translate code from a low-level language to a high-level language

B) To convert source code from one high-level language to another

C) To compile code into machine language

D) To execute code line-by-line for debugging

11. What is a sub-program? [ ]

A) A complete program that runs independently


B) A block of code designed to perform a specific task

C) A variable used for storing data

D) A type of data structure

12. Which of the following is a key benefit of using sub-programs? [ ]

A) Increased code duplication

B) Easier debugging and maintenance

C) Reduced readability

D) Higher memory usage

13. What is the term for data passed into a sub-program? [ ]

A) Return value

B) Argument

C) Variable

D) Statement

14. In which programming paradigm are sub-programs often emphasized as first-class citizens? [ ]

A) Procedural programming

B) Object-oriented programming

C) Functional programming

D) Declarative programming

15. What is the purpose of a return statement in a sub-program? [ ]

A) To end the program execution

B) To pass control back to the caller with a value

C) To declare the type of the sub-program

D) To create a loop

16. Which of the following is a common method for passing parameters to a sub-program [ ]

A) Pass-by-value

B) Pass-by-reference

C) Pass-by-name

D) All of the above


17. What happens when parameters are passed by value? [ ]

A) The original variable can be modified in the sub-program

B) A copy of the variable is made, and changes do not affect the original

C) The variable's address is passed, allowing direct modification

D) The program crashes

18.In pass-by-reference, what is passed to the sub-program? [ ]

A) A copy of the value

B) The variable's memory address

C) A constant value

D) A temporary variable

19. What is a potential downside of using pass-by-reference? [ ]

A) Increased memory usage

B) The original data can be unintentionally modified

C) It requires more code

D) It is slower than pass-by-value

20. Which parameter passing method allows for lazy evaluation? [ ]

A) Pass-by-value

B) Pass-by-reference

C) Pass-by-name

D) Pass-by-object
Fill in the Blanks:

1. The set of rules that defines the structure of valid statements in a programming language is
known as ________

2. The meaning associated with a specific statement or expression in a programming language is


referred to as ________.

3. Context-free grammars are often used to formally define the ________ of programming
languages.

4. Ambiguity in syntax can lead to multiple interpretations, making it difficult to determine the
________ of a program.

5.In programming language design, the distinction between syntax and semantics is crucial for
creating a ________ and reliable language.

6. A ________ is a fixed identifier that represents a value that cannot be changed during program
execution.

7. The ________ environment maintains the mapping of variable names to their corresponding
values and memory locations.

8. Using named constants improves code ________ by providing meaningful names instead of
arbitrary values.

9. In a referencing environment, each variable has an associated ________ that indicates its
current value.

10. If a program attempts to modify a named constant, it typically results in a ________ error during
compilation.

11. In short-circuit evaluation, the second operand is evaluated only if the first operand does not
determine the ________ of the expression.

12. An assignment statement typically assigns a value to a variable using the ________ operator.

13. When using mixed-mode expressions, it is important to be aware of type ________ to avoid
unexpected results during calculations.

14. Short-circuit evaluation is commonly used with logical operators such as ________ and
________.

15. In an assignment statement, the value on the right-hand side is evaluated and then stored in the
variable on the ________ side.

16. When a subprogram is passed as a parameter to another subprogram, it is often referred to as a


________ parameter.
17. Using parameters that are subprograms allows for ________ programming, enabling higher-
order functions.

18. In some languages, you can pass a subprogram as a parameter to create ________ callbacks for
handling events.

19. A subprogram parameter can be defined as a ________ to enhance modularity and reusability of
code.

20. When defining a subprogram that accepts another subprogram as a parameter, it is essential to
ensure that the signatures match in terms of ________ and number of parameters.

MCQ:

Answers :

1.B 2.B 3.A 4.B 5.B 6B. 7.C 8.A 9.B 10.B 11.B 12.B 13.B 14.C 15.B 16.D
17.B 18.B 19.B 20.C

Fill in the blanks Answers

1.syntax 2. semantics 3. syntax 4. semantics 5. consistent 6. named constant 7.


referencing 8. readability 9. binding 10. compilation 11. result 12. assignment 13.
conversion 14 AND, OR 15. left side. 16. functional 17. functional 18. event 19.
procedure 20. type

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