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

Multiple choice technology mainframe
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. 01

  2. Will not change

  3. 56

  4. Will change

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. .NET Framework 2.0 CLR was was introduced with VS 2005

  2. .Net Framework 3.0 uses the .NET Framework 2.0 CLR

  3. .Net Framework 3.5 uses the .NET Framework 2.0 CLR

  4. .Net Framework 3.5 SP1 first time introduce the .NET Framework 3.0 CLR

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. JAVA

  2. C#

  3. VB

  4. C++

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. stops the execution of the entire Natural application

  2. stops the execution of the Natural application and also ends the Natural session

  3. terminates the execution of the processing loop and continues

  4. NONE

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. The Server object

  2. The Application object

  3. The Request object

  4. The Response object

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. To store the global information and variable definitions for the application

  2. Configures the time that the server-side codebehind module is called

  3. To configure the web server

  4. To configure the web browser

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. To store the global information and variable definitions for the application

  2. Configures the time that the server-side codebehind module is called

  3. To configure the web server

  4. To configure the web browser

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Hashtable.

  2. ListDictionary.

  3. Hybrid Dictionary.

  4. NameValueCollection.

  5. StringDictionary.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. After serialization is complete

  2. Before deserialization

  3. After Deserialization is complete

  4. To be called explicitly after serialization

  5. To be called explicitly after Deserialization.

Reveal answer Fill a bubble to check yourself
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.