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
-
Sequential
-
Dynamic
-
Relative
-
Index
-
All the above
B
Correct answer
Explanation
In COBOL, the START statement requires DYNAMIC access mode for indexed or relative files. Dynamic access allows both sequential and random record access, which is necessary because START positions the file for subsequent sequential read operations based on a key value.
-
01 ARRAYS. 05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
-
01 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
-
01 ARRAYS. 05 ARRAY1 PIC X(9) OCCURS INDEXE BY 10 TIMES
-
01 ARRAYS. 88 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
B
Correct answer
Explanation
Option B shows correct COBOL array syntax: the data name at level 01 with PIC clause, OCCURS clause specifying the count, and INDEXED BY clause for the index variable. Option A unnecessarily nests under a group, Option C has 'INDEXE' typo, and Option D incorrectly uses level 88 (reserved for condition names).
A
Correct answer
Explanation
Level 66 is specifically designated for the RENAMES clause in COBOL. This clause allows you to give an alternative name to a contiguous group of elementary items or to reorganize existing data items. Level 77 is for independent items, 88 for condition names, and 01 for record definitions.
-
Serial Search
-
Binary search
-
Tree Search
-
SQL Search
B
Correct answer
Explanation
COBOL's SEARCH ALL verb implements a binary search algorithm. Binary search requires the table to be sorted and repeatedly divides the search interval in half, achieving O(log n) time complexity.
B
Correct answer
Explanation
In COBOL, a program cannot cancel itself or be cancelled by its own subroutines. The CANCEL statement must be executed by a program at a higher level in the calling hierarchy. This prevents attempting to release resources and code that are currently in use.
-
REDEFINES
-
REPLACING
-
REUSE
-
REORG
B
Correct answer
Explanation
In COBOL, the REPLACING phrase of the COPY statement allows text substitutions within the copied source code, enabling the reuse of the same copy library member with modified values.
-
Ounce
-
WebInspect
-
IBM RAD
-
None of the above
A
Correct answer
Explanation
Ounce (now part of IBM) is a static source code analysis tool that examines code for security vulnerabilities without executing it. WebInspect is a dynamic analyzer, IBM RAD is an IDE, and 'None of the above' is incorrect.
-
Ounce
-
WebInspect
-
IBM RAD
-
None of the above
A
Correct answer
Explanation
Ounce (now IBM Security AppScan Source) is a static application security testing (SAST) tool that analyzes source code for security vulnerabilities. WebInspect is a dynamic testing tool, IBM RAD is a development IDE, making Ounce the correct choice for static code analysis.
A
Correct answer
Explanation
The COBOL STRING verb supports ON OVERFLOW and NOT ON OVERFLOW clauses. These allow you to specify conditional processing when the string operation exceeds the target field's size (overflow) or completes successfully without overflow.
-
Byte Code
-
Firewall
-
Tetra Code
-
View Code
A
Correct answer
Explanation
Java achieves cross-platform compatibility by compiling source code into bytecode, which is an intermediate representation. This bytecode can run on any device with a Java Virtual Machine (JVM), enabling the 'write once, run anywhere' capability. The JVM translates bytecode into machine-specific instructions at runtime.
-
Resultset
-
Prepared Statement
-
Statement
-
Number of rows retrieved
D
Correct answer
Explanation
The executeUpdate(String sql) method in JDBC returns an int representing the number of rows affected by the INSERT, UPDATE, or DELETE operation. It does NOT return ResultSet (use executeQuery() for that), PreparedStatement (that's what you call the method ON), or Statement objects.
B
Correct answer
Explanation
The PERFORM VARYING loop iterates with C starting at 1 and incrementing by 1 until C equals 6. Since the condition UNTIL C = 6 is checked before each iteration, the loop runs for C = 1, 2, 3, 4, 5 (5 iterations), and stops when C becomes 6. Therefore RESULT = 5.
-
Skype
-
Toad
-
PL/SQL Developer
-
MySQL
-
MySQL Administrator
D
Correct answer
Explanation
MySQL is a database management system, not a Delphi application. Skype (original Windows version), Toad (database tool), and PL/SQL Developer (Oracle IDE) were built using Delphi/Object Pascal. MySQL Administrator was also written in Delphi. MySQL itself is C/C++ software, making it the correct 'odd one out' for applications NOT written in Delphi.
-
Embarcadero
-
CodeGear
-
Inprise
-
Borland
-
Pascal
E
Correct answer
Explanation
Pascal is a programming language, while Embarcadero, CodeGear, Inprise, and Borland are all company names that owned Delphi at different times in its corporate history. Borland created Delphi, later spun off as CodeGear, acquired by Embarcadero; Inprise was Borland's brief name change. Pascal is the linguistic odd one.
-
DataTable
-
DataView
-
DataRelation
-
DataSet
-
None of these
E
Correct answer
Explanation
ADO.NET has two main architecture models: connected and disconnected. DataSet, DataTable, DataView, and DataRelation are all part of the disconnected architecture - they work with data cached in memory without maintaining active database connections. Connected architecture uses objects like Connection, Command, and DataReader that require active database connections to the database server. Since all options listed are disconnected components, the correct answer is None of these.