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
-
[Bindable]
-
[DefaultProperty]
-
[DataBinding]
-
[AutoUpdate]
A
Correct answer
Explanation
In Adobe Flex, the [Bindable] metadata tag is used to mark a variable or property as eligible for data binding. When a property is marked as bindable, it can be used as the source or destination in data binding expressions, and changes to the property will automatically update bound destinations.
-
sort
-
sortOn
-
reverse
-
sortBy
B
Correct answer
Explanation
In ActionScript, sortOn() sorts an array of objects based on a specific property of each object. The sort() method sorts simple values or requires a custom function, reverse() reverses order, and sortBy() does not exist.
-
Job Cal Language
-
Job Control Language
-
Jobcal Control Language
-
None of the above
B
Correct answer
Explanation
JCL stands for Job Control Language, which is used on IBM mainframe systems (particularly z/OS and MVS) to define and execute jobs. It tells the operating system what programs to run and what resources are needed. 'Job Cal Language' and 'Jobcal Control Language' are not correct expansions.
-
01 ARRAYS. 05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
-
01 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
-
01 ARRAYS. 05 ARRAY1 PIC X(9) OCCURS INDEX BY 10 TIMES
-
01 ARRAYS. 88 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX
A
Correct answer
Explanation
In COBOL, the OCCURS clause cannot be defined at the 01 level (ruling out the second option) or with level 88 condition names (ruling out the fourth). The third option uses incorrect syntax order. The first option correctly defines the table at level 05 with INDEXED BY.
-
uksort()
-
arsort()
-
ksort()
-
All of the above
D
Correct answer
Explanation
PHP provides multiple sorting functions for different sorting needs. uksort() sorts by keys with a custom comparison, arsort() sorts by values in descending order, and ksort() sorts by keys in ascending order. All three are valid array sorting functions in PHP, making All of the above the correct choice.
-
<?php>...</?>
-
<?php…?>
-
<script>...</script>
-
<&>...</&>
B
Correct answer
Explanation
PHP server-side scripts are enclosed in delimiters, which tell the PHP processor to interpret the code between them as PHP. Option A incorrectly uses and ?>, option C shows HTML script tags used for JavaScript, and option D shows invalid syntax.
-
Diamond
-
Java Virtual Machine
-
Java iButton
-
None of these
B,C
Correct answer
Explanation
The Java Ring's core technology is the Java iButton, which contains a Java Virtual Machine (JVM). The JVM enables the iButton to run Java programs, making both B and C correct answers.
-
In high level language (C)
-
Assembly language (low level)
-
Machine Language
-
All of the above
A
Correct answer
Explanation
Unix was originally written in assembly but was rewritten in C in 1973, making it the first major OS written in a high-level language. This portability was revolutionary.
-
List Programming
-
LISt Programming
-
List Instruction Set Programming
-
List Information Set Programming
B
Correct answer
Explanation
LISP stands for LISt Processing, named because the language's primary data structure and fundamental building block is the linked list. It's one of the oldest high-level programming languages, designed specifically for symbolic computation and artificial intelligence research. The capitalized 'LIST' highlights its core programming paradigm.
-
Common Object Business Oriented Language
-
Complete Object Business Oriented Language
-
Common Object BASIC Oriented Language
-
Common Oriented Business Object Language
A
Correct answer
Explanation
COBOL stands for Common Business-Oriented Language, designed specifically for business, finance, and administrative systems. It was created to be easily readable by non-technical programmers, using English-like statements for business data processing. The language remains widely used in legacy enterprise systems today.
-
FORmula TRANslation
-
FORmula TRANslator
-
FORmal TRANslation
-
FORmal TRANslator
B
Correct answer
Explanation
FORTRAN stands for FORmula TRANslation, designed primarily for numerical and scientific computing. It was the first high-level programming language, created to make scientific calculations easier by translating mathematical formulas directly into executable code. The name reflects its core purpose of simplifying formula translation for scientists and engineers.
-
Begin All Program Symbolic Instruction Code
-
Beginners' All-purpose Symbolic Information Code
-
Beginners' All-purpose System Instruction Code
-
Beginners' All-purpose Symbolic Instruction Code
D
Correct answer
Explanation
BASIC stands for Beginners' All-purpose Symbolic Instruction Code, designed to make programming accessible to beginners while remaining versatile enough for general use. It was created to help students learn programming concepts without getting overwhelmed by complex syntax. The 'All-purpose' indicates it can handle various types of programming tasks.
-
Encoder
-
Converter
-
Compiler
-
Translator
C
Correct answer
Explanation
A compiler converts human-readable source code into machine-readable executable code. An encoder changes data format, a converter translates between file types, and a translator converts between natural languages.
C
Correct answer
Explanation
Smalltalk (developed at Xerox PARC in the 1970s) was the first programming language to fully implement all core OOP concepts: objects, classes, inheritance, encapsulation, and polymorphism. While Simula 67 introduced some object-oriented concepts, Smalltalk was the first complete OOP system. C++ and Java came later.
-
int *array1 = (int *)malloc(nrows * sizeof(int *));
-
int *array2 = (int *)malloc(nrows * sizeof(int *));
-
int *array3 = (int *)malloc(nrows * ncolumns * sizeof(int));
-
Any of the above.
D
Correct answer
Explanation
All three methods are valid approaches to allocate 2D arrays dynamically. Option A allocates an array of pointers then each row separately (pointer-to-pointer). Option B appears identical to A in the garbled text but represents the same approach. Option C allocates a single contiguous block and uses arithmetic to index (flattened 2D array). Each has trade-offs in syntax and memory layout.