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
-
BEGIN SUBROUTINE
-
SUBROUTINE
-
SUBROUTINE BEGIN
-
START SUBROUTINE
B
Correct answer
Explanation
SUBROUTINE is the statement that begins a subroutine definition in Model 204. You specify SUBROUTINE followed by the subroutine name to start the block.
-
Variable
-
label
-
statement
-
function
B
Correct answer
Explanation
In Model 204 syntax, 'A:' at the beginning of a line defines a label named A. Labels are reference points for branching and control flow within procedures.
-
JUMP
-
JUMP TO
-
CALL
-
CALL TO
C
Correct answer
Explanation
The CALL statement is used to transfer control to a subroutine in many programming languages. JUMP and JUMP TO are used for unconditional branching within the same program, not for calling subroutines.
-
JUMP
-
JUMP TO
-
CALL
-
CALL TO
A
Correct answer
Explanation
The JUMP statement is used to transfer control to another statement or label within the same request. CALL is for subroutines, while JUMP TO is not the correct syntax for this purpose.
-
TABLE A
-
TABLE B
-
TABLE C
-
TABLE D
B
Correct answer
Explanation
In Model 204 file architecture, Table B contains the actual record data, including all retrievable field values for the records in the file.
A
Correct answer
Explanation
PAI (Print All Information) is the command that outputs complete records in systems like ADABAS/NATURAL. PRINT ALL would be the logical English expansion but PAI is the actual command. PRINT alone may have different behavior, and FPC is a different command entirely.
-
DELETE RECORD
-
DELETE
-
DELETE FIELD
-
REMOVE
B
Correct answer
Explanation
DELETE is the M204 statement that removes fields from a record. DELETE RECORD would remove the entire record, not just fields. DELETE FIELD and REMOVE are not valid M204 syntax for field removal.
A
Correct answer
Explanation
FPC (Find and Print Count) is the M204 command that counts and displays the number of records satisfying a condition. WOL is for ordered retrieval, FCOUNT is not a valid M204 command, and FRC is not a standard command.
-
'ACCOU'
-
NULL STRING
-
ACCO'
-
COUNT'
-
The loop is skipped
-
The loop is repeated for all the values of the field
-
Infinite loop
-
The loop is executed once.
B
Correct answer
Explanation
In Model 204, when K is negative in 'FOR K VALUES OF FIELDNAME', the statement loops through ALL occurrences of the field, not just a limited number. This is a special case where a negative value acts as a flag to process the entire set. Option B correctly describes this behavior. Options A and D are incorrect because the loop is neither skipped nor executed just once. Option C is incorrect because the loop terminates after processing all values.
-
The FOR EACH RECORD IN ORDER BY statement retrieves and loops only on the first occurrence of a field in a record
-
The FOR EACH RECORD IN ORDER BY statement loops only on the first occurrence of a field in a record
-
The FOR EACH RECORD IN ORDER BY statement retrieves and loops on all the occurrence of a field in a record
-
The FOR EACH RECORD IN ORDER BY statement retrieves and loops on only the last occurrence of a field in a record
A
Correct answer
Explanation
The FOR EACH RECORD IN ORDER BY statement both retrieves and loops through only the FIRST occurrence of a field in each record, not all occurrences. This is important when you want to process unique records without duplicate field values. Option A correctly describes this behavior. Options B, C, and D are incorrect because the statement doesn't just loop without retrieval, doesn't process all occurrences, and isn't limited to the last occurrence.
-
The count obtained by the COUNT OCCURRENCES statement.
-
The Count obtained from counting the number of 'IN' in your M204 Code.
-
Counting of the M204 Database files used in the Code
-
Count obtained by the Count Statement.
A
Correct answer
Explanation
The COUNT IN clause refers specifically to the count value generated by the COUNT OCCURRENCES statement, not to counting 'IN' keywords or database files. This allows you to use the occurrence count in subsequent operations. Option A correctly identifies this relationship. Options B and D are incorrect because COUNT IN doesn't count keywords or use a generic Count statement. Option C is incorrect because it doesn't count database files.
A
Correct answer
Explanation
In Model 204, TTBL (terminal table), GTBL (global table), and STBL (screen table) are valid user language working areas. FSBC is NOT a valid working area in the Model 204 system. Option A correctly identifies FSBC as invalid. Options B, C, and D are incorrect because they list valid working areas (TTBL, GTBL, STBL).
-
ADD statement
-
CHANGE statement
-
STORE RECORD statement
-
All the Above
D
Correct answer
Explanation
The VALUE IN statement can be used with ADD, CHANGE, and STORE RECORD statements in Model 204, making it versatile for field manipulation. It allows you to reference specific values within these operations. Option D correctly states that VALUE IN works with all three statement types. Options A, B, and C are incorrect because VALUE IN isn't limited to just one of these statements - it works with all of them.
-
CHANGE FULLNAME TO NULL
-
CHANGE FULLNAME TO ‘NULL’
-
CHANGE FULLNAME TO 0
-
DELETE FULLNAME
D
Correct answer
Explanation
The statement 'CHANGE FULLNAME TO' with no value specified is equivalent to 'DELETE FULLNAME' - it removes the field from the record. This is a shorthand way to delete a field without explicitly using the DELETE command. Option D correctly identifies this equivalence. Options A, B, and C are incorrect because they attempt to assign specific values (NULL as keyword, string, or number) when the actual operation is deletion.