Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
Message
-
StackTrace
-
Source
-
Data
B
Correct answer
Explanation
The StackTrace property contains the execution history of the call stack, which includes the file names and line numbers where an exception originated. Message only describes the exception, Source identifies the assembly, and Data contains custom key-value pairs.
-
Low level
-
High level
-
Both 1 and 2
-
None
A
Correct answer
Explanation
Assembler is a low-level language that provides direct mnemonic representation of machine instructions with minimal abstraction from hardware.
-
Subscript Checking
-
Efficiently handling Array
-
No Such Option exists
-
Array bound Checking
D
Correct answer
Explanation
The SSRANGE compiler option in COBOL generates code to check whether subscripts, indexes, or reference modifiers exceed the declared boundaries of an array at runtime, ensuring array bound checking. If subscripts are out of bounds, a runtime error is raised, preventing memory corruption or access to invalid locations.
-
automatic
-
enigmatic
-
pragmatic
-
syntactic
D
Correct answer
Explanation
In Object-Oriented Programming, the binding between data and the operations that can be performed on it is described as 'syntactic' because it follows the syntax rules of the language. This close binding is a fundamental characteristic of OOP languages.
-
generates
-
articulates
-
manipulates
-
eradicates
C
Correct answer
Explanation
When programmers work with classes and objects, they create code that 'manipulates' objects: changing their state, calling their methods, and using their properties. The sentence describes the active control programmers exercise over object instances.
A
Correct answer
Explanation
In COBOL, array indexes (also called subscripts) are internal working-storage variables used to access table elements. These indexes are defined in the WORKING-STORAGE section and can be displayed using standard DISPLAY statements like other data items, but the question's wording suggests it refers to internal implementation details not directly visible.
-
Infinite loop
-
Logical Error
-
Runtime Error
-
All the above
D
Correct answer
Explanation
A COBOL IF statement can experience logical errors (incorrect condition formulation), runtime errors (type mismatches or invalid comparisons), and can potentially contribute to infinite loops if condition evaluation never becomes false. These represent the major categories of programming errors that can manifest within conditional logic.
-
for loop
-
do while loop
-
nested loop
-
none of the above
B
Correct answer
Explanation
The COBOL PERFORM loop is equivalent to a do-while loop found in languages like Java and C++. Both structures execute the loop body at least once before testing the continuation condition, making them different from while loops which test the condition before the first iteration.
-
Identification Division
-
Linkage Division
-
Data Division
-
Procedure Division
B
Correct answer
Explanation
The four standard divisions in a COBOL program are Identification, Environment, Data, and Procedure. Linkage Division is not one of the four main divisions; it is a special division used specifically for defining parameters passed to a program when called from another program. The correct answer is B (Linkage Division).
-
COmputer Basic Operating Language
-
COmmon Business Oriented Language
-
Common OBservation Official Language
-
none of the above
B
Correct answer
Explanation
COBOL stands for COmmon Business Oriented Language. It was designed in 1959 for business, finance, and administrative systems. The name directly reflects its purpose - a common language for business applications.
A
Correct answer
Explanation
Microsoft's codename for their ASP.NET AJAX framework implementation was 'Atlas.' This was the official internal name during development before being branded as ASP.NET AJAX when released for the .NET Framework 2.0. Option A is correct. 'Bullet,' 'Katmai' (a SQL Server codename), and 'Jolt' are not associated with ASP.NET AJAX.
-
a runtime error
-
No error is displayed
-
a compile time error
-
Only warning message is displayed
A
Correct answer
Explanation
FieldDefault PeopleCode executes during runtime processing, not during compilation. If an error occurs in FieldDefault logic, it manifests as a runtime error when the code executes. Compile-time errors occur when PeopleCode is saved/compiled, not when FieldDefault logic runs.
-
REASSIGN
-
REDECLARE
-
REDEFINE
-
None of the above
C
Correct answer
Explanation
In languages like Software AG's Natural or COBOL (with REDEFINES), the REDEFINE statement is used to refine or restructure already declared variables or memory fields. This allows programmers to map new structures or different data types to the same physical memory space.
-
A programming language
-
Extremely versatile language
-
Restructured Extended Executor Language
-
High-level procedural language
-
All of the above
E
Correct answer
Explanation
REXX (Restructured Extended Executor) is a high-level programming language that was designed to be extremely versatile. It can be used for various purposes including scripting, automation, and system interaction. Therefore, all the given descriptions are correct, making option E the right answer.
B
Correct answer
Explanation
REXX is an interpreted language, not a compiled one. The REXX interpreter reads and executes the source code directly without a compilation step. This is a key feature of REXX - you can write and test code immediately without waiting for compilation. Compiled languages like COBOL or PL/I require a compilation step to produce object code before execution. The statement that REXX requires compilation is false.