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
A
Correct answer
Explanation
The EJECT statement in COBOL is used to force a page break in the compiler listing output. When the compiler encounters EJECT, it advances to a new page before continuing compilation. This helps organize the listing into logical sections for better readability and debugging.
A
Correct answer
Explanation
ASCENDING and DESCENDING KEY clauses in COBOL specify sort keys, and these cannot be floating-point data items. Floating-point numbers have imprecise comparison behavior due to representation issues, which makes them unreliable for sorting operations where exact ordering is required. COBOL prohibits using COMP-1 or COMP-2 items as sort keys for this reason.
A
Correct answer
Explanation
This is valid Natural language syntax. DEFINE DATA LOCAL defines local variables, END-DEFINE terminates the definition block, MOVE assigns a string literal to the variable, WRITE outputs it to the screen, and END terminates the program. The indentation and structure follow Natural programming conventions correctly.
-
01
-
Will not change
-
56
-
Will change
B
Correct answer
Explanation
In COBOL, NEXT SENTENCE immediately transfers control to the next sentence following the period. Because ADD +1 TO INPUT-COUNT is inside the same sentence (terminated by the period after TEST-1), transferring control to the next sentence bypasses the increment logic, leaving INPUT-COUNT unchanged.
D
Correct answer
Explanation
J2EE (Java 2 Enterprise Edition) components are written in Java. The 'Java' in the name indicates the programming language. C, C++, and C# are not used for J2EE components.
-
.NET Framework 2.0 CLR was was introduced with VS 2005
-
.Net Framework 3.0 uses the .NET Framework 2.0 CLR
-
.Net Framework 3.5 uses the .NET Framework 2.0 CLR
-
.Net Framework 3.5 SP1 first time introduce the .NET Framework 3.0 CLR
D
Correct answer
Explanation
.NET Framework 2.0 CLR shipped with VS 2005 (A is true). .NET 3.0 and 3.5 both use CLR 2.0 (B and C are true). .NET 3.5 SP1 still used CLR 2.0 - the 3.0 CLR didn't exist as a distinct version. CLR changed to 4.0 only with .NET Framework 4.0. Option D is false.
C
Correct answer
Explanation
The E-App (Electronic Application) system is built using VB (Visual Basic). This is a legacy technology choice common in enterprise applications, particularly in the insurance and financial services domain.
-
stops the execution of the entire Natural application
-
stops the execution of the Natural application and also ends the Natural session
-
terminates the execution of the processing loop and continues
-
NONE
C
Correct answer
Explanation
The ESCAPE statement in Natural terminates the current processing loop and continues execution with the statement following the loop. It does not stop the entire application or session.
-
The Server object
-
The Application object
-
The Request object
-
The Response object
A
Correct answer
Explanation
The ASP.NET Server object provides access to server-side methods and properties, including information about the web server. It can be used to execute server methods (like Server.MapPath() for file paths) and access server utilities. The Application object stores global application state, Request handles incoming HTTP data, and Response manages outgoing HTTP data - none provide direct web server information.
-
To store the global information and variable definitions for the application
-
Configures the time that the server-side codebehind module is called
-
To configure the web server
-
To configure the web browser
A
Correct answer
Explanation
Web.config is an XML-based configuration file for ASP.NET applications. It stores application-wide settings including connection strings, custom application variables, authentication rules, and compilation settings. It does NOT configure the web server (that's web.config for IIS or machine.config) or the web browser (browser settings are client-side). The answer correctly identifies its purpose for storing global application information.
-
To store the global information and variable definitions for the application
-
Configures the time that the server-side codebehind module is called
-
To configure the web server
-
To configure the web browser
A
Correct answer
Explanation
The Web.config file is the primary configuration file for ASP.NET applications, storing application-wide variables, database connection strings, and security settings.
-
The Server object
-
The Application object
-
The Request object
-
The Response object
A
Correct answer
Explanation
The Server object (HttpServerUtility) provides access to utility methods and properties on the server, such as machine name and request timeout information.
A
Correct answer
Explanation
SEARCH ALL performs a binary search in COBOL tables. For predictable results, the table must be defined with ASCENDING or DESCENDING KEY, and the key must uniquely identify each table entry. Without these conditions, binary search behavior is undefined.
-
Hashtable.
-
ListDictionary.
-
Hybrid Dictionary.
-
NameValueCollection.
-
StringDictionary.
E
Correct answer
Explanation
StringDictionary is specifically designed to store name/value pairs where both keys and values are strongly typed as strings. It provides a type-safe string-to-string mapping. Hashtable and ListDictionary are not strongly typed (they store objects), HybridDictionary switches between the two, and NameValueCollection allows multiple values per key.
-
After serialization is complete
-
Before deserialization
-
After Deserialization is complete
-
To be called explicitly after serialization
-
To be called explicitly after Deserialization.
C
Correct answer
Explanation
The IDeserializationCallback.OnDeserialization() method is invoked automatically by the runtime after deserialization of an object is complete. This allows objects to perform any necessary post-deserialization initialization. It is not called during serialization (A), nor must it be called explicitly (D, E). Option B is incorrect because the method fires after deserialization completes, not before it begins.