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
-
Send Activity
-
Web Service Input Activity
-
Receive Activity
-
None of These
C
Correct answer
Explanation
In .NET Framework 3.5, Windows Workflow Foundation (WF) introduced the Receive activity as part of the Workflow Service API. This activity allows workflows to be exposed as WCF services, enabling the workflow to receive and process messages from service clients. The Send activity complements it for sending messages, but Receive is specifically for exposing workflows as services.
B
Correct answer
Explanation
In PROC FREQ, the TABLES statement is used to specify which variables to analyze. The VAR statement is used in PROC MEANS and PROC SUMMARY, not PROC FREQ.
-
a. BAIXXX_Client
-
b. BAIXXX_Interfaces
-
c.BAIXXX_mplementation
-
d. BSIXXX_Client
-
e. BSIXXX_Interfaces
-
f. BSIXXX_Implementation
A,B
Correct answer
Explanation
To resolve compile-time errors in the BAIXXX_WEB project, you need to add BAIXXX_Client and BAIXXX_Interfaces as dependencies. The Client component provides necessary client-side functionality, while Interfaces defines the contracts and APIs. The Implementation component is not typically required at compile-time for the web layer. BSIXXX components are unrelated and would introduce incorrect dependencies.
-
a. JDK 1.3
-
b. JDK 1.4
-
c. JDK 5.0
-
d. JDK 6.0
A,C
Correct answer
Explanation
The question asks which JDK versions are used in IB (likely an Investment Banking system), and the correct answers are JDK 1.3 and JDK 5.0. Legacy financial systems often run on older JDK versions for stability and compatibility reasons. JDK 1.4 and 6.0 are marked as incorrect, suggesting this particular environment doesn't use those versions.
A
Correct answer
Explanation
The doPost() method is used for sending sensitive data because it sends data in the request body (not visible in URL), has no size limit, and is more secure than doGet(). doGet() exposes parameters in the URL, making it unsuitable for sensitive information.
-
Division
-
Paragraph
-
Clause
-
Character
-
Program
-
All the above
F
Correct answer
Explanation
COBOL programs are hierarchically structured with multiple organizational levels. A Program contains Divisions, Divisions contain Sections, Sections contain Paragraphs, Paragraphs contain Sentences, Sentences contain Statements, and Statements contain Clauses. All these components (Division, Paragraph, Clause, Character, Program) are valid parts of COBOL structure.
-
Syntactically valid combination of words and clauses
-
Sequence of one or more statements terminated by period
-
Words and characters specifying attribute of entry
-
Syntactically valid combination of words
-
Sequence of one or more statements terminated by comma
C
Correct answer
Explanation
In COBOL, a Clause is the lowest-level syntactic unit that specifies attributes or characteristics of an entry. Clauses consist of words and characters that define properties like data types, picture clauses, or usage clauses. They are not complete statements (terminated by periods) but rather descriptive elements within entries.
-
RENAME
-
REDEFINE
-
CONDITION NAMES
-
NONE
-
ALL
A
Correct answer
Explanation
In COBOL, the LEVEL-66 clause is the RENAME clause. It allows you to regroup existing data items under an alternative name for easier reference. RENAME (level 66) is different from REDEFINES (level 01-49) and CONDITION NAMES (level 88).
-
Numeric
-
Alphabetic
-
Alpha-numeric
-
Numeric Edited
-
01-03
-
ALL
F
Correct answer
Explanation
COBOL supports various data categories including numeric, alphabetic, alphanumeric, and numeric-edited fields, which are defined using different PICTURE clause symbols. Since all these options represent valid data types in COBOL, the correct selection is 'ALL'.
A
Correct answer
Explanation
SEARCH ALL requires the table to be arranged in a specific order (ASCENDING or DESCENDING) as defined by the KEY clause. For predictable results, the key must uniquely identify each table entry. If duplicates exist, SEARCH ALL may return any matching entry, making the result unpredictable. This requirement is due to the binary search algorithm used.
-
Identification Division
-
Environment Division
-
Data Division
-
Procedure Division
A
Correct answer
Explanation
Only the Identification Division is mandatory in every COBOL program. It contains the program identifier and is required for compilation. Environment, Data, and Procedure Divisions may be omitted in minimal programs.
-
Identification Division
-
Environment Division
-
Data Division
-
Procedure Division
A
Correct answer
Explanation
Only the Identification Division is mandatory in every COBOL program. It contains the program identifier and is required for compilation. Environment, Data, and Procedure Divisions may be omitted in minimal programs.
A
Correct answer
Explanation
SEARCH ALL uses a binary search algorithm, which requires the table to be sorted in a known order (ASCENDING or DESCENDING). Additionally, for binary search to work correctly and predictably, each key value must be unique so the search can definitively locate a single occurrence. Option A correctly states both requirements.
-
Custom Attributes
-
Funtional Attributes
-
Predefined Attributes
-
Both A & C
D
Correct answer
Explanation
.NET supports both Custom Attributes (user-defined) and Predefined Attributes (built-in like [Serializable], [Obsolete]). Functional Attributes do not exist as a category in .NET.