1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Question 1: Which of the following is a primary goal of a programming language?
· - To provide a simple syntax
· - To facilitate communication between the programmer and the computer
· - To execute the program faster
· - To support multiple hardware platforms
· - None of these
To facilitate communication between the programmer and the computer
Question 2: Which of the following is an example of a low-level programming language?
· - Python
· - Java
· - C++
· - Assembly language
Question 2: Assembly language
Question 3: What is the role of a compiler in programming languages?
· - To execute the program
· - To translate source code into machine code
· - To check for syntax errors
· - To provide an interactive environment for the programmer
Question 3: To translate source code into machine code
Question 4: Which of the following is NOT a feature of high-level programming languages?
· - Machine independence
· - Easy readability
· - Direct manipulation of hardware
· - Automatic memory management
Question 4: Direct manipulation of hardware
Question 5: Which of the following is a feature of a structured programming language?
· - Use of goto statements
· - Use of function calls and loops to organize code
· - Direct memory manipulation
· - Use of object classes
Question 5: Use of function calls and loops to organize code
Question 6: Which characteristic distinguishes a compiled language from an interpreted language?
· - Compiled languages require an interpreter to run.
· - Interpreted languages translate code into machine code before execution.
· - Compiled languages translate source code into machine code before execution.
· - There is no difference between compiled and interpreted languages.
Question 6: Compiled languages translate source code into machine code before execution.
Question 7: Which of the following is an advantage of a language like Java, which is compiled into bytecode and then interpreted by a virtual machine?
· - It runs faster than native compiled languages.
· - It is more portable across different operating systems.
· - It requires less memory than native compiled languages.
· - It simplifies debugging by eliminating runtime errors.
Question 7: It is more portable across different operating systems.
Question 8: Which of the following is an example of a declarative programming language?
· - SQL
· - C++
· - Java
· - Fortran
Question 8: SQL
Question 9: Which of these is a feature of functional programming languages?
· - Emphasis on the use of objects
· - Focus on statements that change program state
· - Programs are built around functions that transform data
· - Direct interaction with hardware
Question 9: Programs are built around functions that transform data
Question 10: In the context of programming languages, what does 'syntax' refer to?
· - The meaning of various constructs in the language
· - The rules that define the structure of valid statements
· - The memory management techniques
· - The ability of the language to support multiple platforms
Question 10: The rules that define the structure of valid statements
Question 11: The Von Neumann Architecture is based on the concept of a 'stored-program' where both instructions and data are stored in the same memory.
· - True
· - False
Question 11: True
Question 12: In a typical computer, the data and instructions are stored in the same memory, which leads to the problem of:
· - Data corruption
· - Memory fragmentation
· - The Von Neumann bottleneck
· - Data overflow
Question 12: The Von Neumann bottleneck
Question 13: Choose ALL strings that can be generated by 10*
· - 10
· - Empty String
· - 1010
· - 100
· - 100000
Question 13: 10, 100, 100000
Question 14: Regular Expressions are used to generate / verify lexemes
· - True
· - False
Question 14: True
Question 15: (1|0)* is same as (0|1)*
· - True
· - False
Question 15: True
Question 16: Choose ALL strings that can be generated by both ab* and (ab)*
· - Empty String
· - abb
· - a
· - ab
· - abab
· - None of these
Question 16: ab
Question 17: Empty string can be generated by a|b*
· - True
· - False
Question 17: True
Question 18: Two distinct strings with 2 alphabets can be generated by a|b*.
· - True
· - False
Question 18: False
Question 19: Two distinct strings with 2 alphabets can be generated by ab|b*.
· - True
· - False
Question 19: True
Question 20: The strings generated by ab|b* can be described as 'a followed by one or more b'
· - True
· - False
Question 20: False
Question 21: 'ab' can be generated by both ab* and (ab)*
· - True
· - False
Question 21: True
Question 22: The regular expression a(a|b)+ | b(a|b)+ is equivalent to (a|b)*
· - True
· - False
Question 22: True
Question 23: What Token category does a variable 'average' belong to?
· - Reserved word
· - Identifier
· - Literal or Constant
· - Special Symbol
Question 23: Identifier
Question 24: What Token category does 'int' belong to?
· - Reserved word
· - Identifier
· - Literal or Constant
· - Special Symbol
Question 24: Reserved word
Question 25: What Token category does '23' belong to?
· - Reserved word
· - Identifier
· - Literal or Constant
· - Special Symbol
Question 25: Literal or Constant
Question 26: What Token category does 'hello world!' belong to?
· - Reserved word
· - Identifier
· - Literal or Constant
· - Special Symbol
Question 26: Literal or Constant
Question 27: What Token category does '++' belong to?
· - Reserved word
· - Identifier
· - Literal or Constant
· - Special Symbol
Question 27: Special Symbol
Question 28: In a BNF, a rule can have multiple RHS
· - True
· - False
Question 28: True
Question 29: Consider the following statement: 'int sum = n + 10 /* assignment statement */;'. Select all Lexemes:
· - sum
· - n
· - ;
· - /*
· - assignment
Question 29: sum, n, ;
Question 30: Which Token category does 'sum' belong to?
· - Identifier
· - Constant
· - Symbol
· - Reserved Word
· - None of these
Question 30: Identifier
Question 31: Which Token category does '->' belong to?
· - Identifier
· - Constant
· - Symbol
· - Reserved Word
· - None of these
Question 31: None of these
Question 32: Which Token category does ';' belong to?
· - Identifier
· - Constant
· - Symbol
· - Reserved Word
· - None of these
Question 32: Symbol