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
-
CALL STATEMENT
-
ADD STATEMENT
-
LEVEL NUMBERS
-
IF STATEMENT
C
Correct answer
Explanation
Easytrieve defines fields using flat starting positions and length attributes, completely omitting COBOL's structured level numbers (like 01, 05). It still retains logical constructs like IF, ADD, and CALL.
-
FILE INFILE FB(80 800)
-
FILE INFILE VS
-
FILE INFILE VB(100 504)
-
NONE OF THE ABOVE
B
Correct answer
Explanation
To solve this question, the user needs to have knowledge of VSAM files and how they are defined in JCL.
Option A: FILE INFILE FB(80 800)
This option represents a flat file. The FB indicates that the file is fixed blocked, and the numbers in the parentheses specify the record length (80) and the block size (800). This is not a VSAM file.
Option B: FILE INFILE VS
This option represents a VSAM file. The "VS" indicates that it is a VSAM file. However, this option is incomplete since it does not specify the file organization (KSDS, ESDS, or RRDS) and the access method (ESDS or RRDS).
Option C: FILE INFILE VB(100 504)
This option represents a variable blocked file. The VB indicates that the file is variable blocked, and the numbers in the parentheses specify the maximum record length (100) and the block size (504). This is not a VSAM file.
Therefore, the correct answer is:
The Answer is: B
-
FILE IS A FIXED BLOCK FILE WITH RECORD LENGTH 150 AND BLOCK SIZE 0
-
FILE IS A FIXED BLOCK FILE WITH RECORD LENGTH 0 AND BLOCK SIZE 150
-
FILE IS A VSAM FILE WITH RECORD LENGTH 150 AND BLOCK SIZE 0
-
FILE IS A VARIABLE BLOCK FILE WITH RECORD LENGTH 150 AND BLOCK SIZE 0
A
Correct answer
Explanation
In EasyTrieve file declaration, FB(150 0) represents a Fixed Block (FB) file with record length 150 and block size 0. Fixed block means records are of fixed length, 150 specifies the record size in bytes, and 0 indicates system-determined block size. The syntax is FB(record-length block-size).
-
TABLE INFORMATION
-
INDEX
-
FILE INFORMATION
-
NONE OF THE ABOVE
A
Correct answer
Explanation
The SEARCH statement in EasyTrieve provides access to TABLE information. It allows searching through table entries to find specific values or matching criteria. Tables are data structures used for lookups and comparisons, and SEARCH is the mechanism to access and query them.
-
SELECT
-
CASE
-
ESTIMATE
-
SEARCH
B
Correct answer
Explanation
CASE is used in EasyTrieve instead of EVALUATE in COBOL for conditional branching based on multiple possible values. Both serve similar purposes - allowing different actions based on a variable's value - but CASE is the EasyTrieve keyword. SELECT is for file processing, ESTIMATE doesn't exist in EasyTrieve, and SEARCH is for table lookups.
C
Correct answer
Explanation
The WRITE statement in COBOL is used to output records. Associated statements include ADD, UPDATE, and DELETE which are data manipulation operations. MOVE is a data transfer statement that moves data between variables, not directly associated with WRITE operations in the context of file or database operations.
-
echo
-
print_r
-
display
-
all the above
B
Correct answer
Explanation
The print_r function formats and outputs human-readable information about a variable, including complex structures like arrays. Using echo directly on an array produces an Array-to-string conversion notice and prints only the word 'Array'.
-
echo
-
printf
-
print
-
display
C
Correct answer
Explanation
In PHP, 'print' is a language construct that behaves like a function but doesn't require parentheses. It always returns 1, making it usable in expressions. 'echo' is also a construct but cannot be used in expressions. 'printf' is a true function that requires parentheses.
-
$mprjet
-
$mpjret
-
$mejret
-
None of the above
B
Correct answer
Explanation
The $mpjret variable contains the return code or status of graph execution in Ab Initio. This variable is automatically set after graph completion and can be checked to determine if the graph succeeded or failed. The other variable names ($mprjet, $mejret) are not standard Ab Initio system variables.
-
Is_valid()
-
Is_null()
-
Is_blank()
-
Is_defined()
B,D
Correct answer
Explanation
Is_null() specifically checks for NULL values in Ab Initio. Is_defined() checks whether a value is defined (not NULL). Both are valid for NULL checking, though they work oppositely. Is_valid() validates data type/format, and Is_blank() checks for empty/blank strings.
-
ABLOCAL() function
-
AB_LOCAL()function
-
AB-LOCAL() function
-
AB_UNLOAD() function.
A
Correct answer
Explanation
ABLOCAL() allows Ab Initio to partition database unload operations, with each partition handling a subset of data. This enables parallel processing for faster data extraction. The function name must use an underscore (ABLOCAL not AB_LOCAL or AB-LOCAL).
-
You can define your own data types
-
An object oriented program can be taught to correct its own errors
-
It is easier to conceptualize an object oriented program
-
You can define your own data types and It is easier to conceptualize an object oriented program
D
Correct answer
Explanation
Object-oriented programming allows developers to define custom data types using classes and model programs around real-world entities, which makes system conceptualization much easier. Programs cannot automatically teach themselves to resolve runtime errors, meaning the option combining custom types and conceptualization is correct.
-
Switch case
-
For
-
If else
-
Go to
C
Correct answer
Explanation
The Branch operation in webMethods Developer evaluates conditional expressions and routes execution to different branches based on the result, which is directly analogous to if-else statements in C and other programming languages. Unlike switch-case (which matches a single value against multiple cases), Branch supports complex conditional expressions like if-else.
-
Ken Thompson
-
Dennis Ritchie
-
Ken Thompson and Dennis Ritchie
-
None
B
Correct answer
Explanation
The correct answer is Dennis Ritchie. While Ken Thompson was also instrumental at Bell Labs, Dennis Ritchie is specifically credited as the primary developer of the C language in the early 1970s. Option C incorrectly suggests they developed it together - Ritchie was the lead creator.
-
B, Algol 68
-
Assembly, PL/I
-
Fortran
-
All the Above
D
Correct answer
Explanation
C was historically influenced by B and Algol 68. However, early programming languages like Fortran, assembly languages, and PL/I also heavily shaped systems programming concepts during its development at Bell Labs. Therefore, 'All the Above' is the most complete and correct option.