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
A
Correct answer
Explanation
JCL (Job Control Language) is indeed a scripting language used on IBM mainframe operating systems (like z/OS) to instruct the system on how to run batch jobs. It defines the job's steps, resources needed, and execution parameters.
A
Correct answer
Explanation
Logo is both a simple educational programming language and a common term for a corporate symbol or emblem. The other options are incorrect: interurban relates to cities, Java and C++ are more complex programming languages not typically described as 'simple'.
-
a low-level programming language.
-
a scripting language precompiled in the browser.
-
a compiled scripting language
-
an object-oriented scripting language
D
Correct answer
Explanation
JavaScript is fundamentally an object-oriented scripting language that runs primarily in web browsers. It uses prototype-based inheritance rather than class-based inheritance. It's not a low-level language, not precompiled in browsers (interpreted), and while modern engines compile it, its design is as a dynamic scripting language.
-
One is not a method of the String object.
-
substr() takes three arguments, substring() only two.
-
Only one accepts a desired string length as an argument.
-
Besides the spelling, nothing
C
Correct answer
Explanation
substr() accepts a start position and length parameter, while substring() takes start and end positions. Only substr() allows specifying the desired string length directly. Option A is incorrect because both are String methods. Option B is wrong because neither takes three arguments. Option D is false because their parameter semantics differ fundamentally.
-
One is not a method of the String object.
-
substr() takes three arguments, substring() only two.
-
Only one accepts a desired string length as an argument.
-
Besides the spelling, nothing
C
Correct answer
Explanation
substr() accepts a start position and length parameter, while substring() takes start and end positions. Only substr() allows specifying the desired string length directly. Option A is incorrect because both are String methods. Option B is wrong because neither takes three arguments. Option D is false because their parameter semantics differ fundamentally.
-
The Java console
-
LiveConnect
-
LiveWire
-
LiveWire Pro
B
Correct answer
Explanation
LiveConnect was the technology that enabled JavaScript to communicate with Java applets, allowing JavaScript to call Java methods and access Java properties. LiveWire and LiveWire Pro were server-side JavaScript technologies. The Java console is a debugging tool, not an integration mechanism.
-
for(var i = 0; i < myString.length; i++) {
-
var myArray = myString.split('x'); myString = myArray.join('');
-
It wasn't possible until now. Thanks JavaScript1.2!
-
The first two both work fine
D
Correct answer
Explanation
Before JavaScript 1.2's enhanced String.replace(), you could remove characters using two approaches: 1) iterate through the string building a new string without 'x', or 2) split on 'x' and join the array with empty string. Both methods work, though split/join is more concise.
-
platform independent
-
platform dependent
-
traditional language
-
None
A
Correct answer
Explanation
Java is platform-independent because Java bytecode (.class files) can run on any device that has a Java Virtual Machine (JVM). The 'Write Once, Run Anywhere' (WORA) principle means compiled Java code doesn't need to be recompiled for different platforms. This is a fundamental design feature of Java, making it different from platform-dependent languages like C++.
D
Correct answer
Explanation
Check is a unit testing framework for the C programming language. It provides a simple way to write and run tests for C code. The other languages listed (Java, PHP, HTML) have their own testing frameworks but Check is specifically designed for C.
C
Correct answer
Explanation
The while loop copies 'name' to p2 but both p1 and p2 are incremented after each assignment. When the loop exits, p2 points to the null terminator, so printf(%s, p2) prints an empty string. The key is understanding post-increment behavior.
C
Correct answer
Explanation
This is identical to question 82605. The while loop copies 'name' to p2 but both p1 and p2 are incremented after each assignment. When the loop exits, p2 points to the null terminator, so printf(%s, p2) prints an empty string.
A
Correct answer
Explanation
x=y++ + x++: x = 35 + 20 = 55, then y becomes 36, x becomes 56. y= ++y + ++x: y increments to 37 first, x increments to 57 first, so y = 37 + 57 = 94. Final output: 57 94. Requires understanding pre and post increment.
-
4,21,1
-
5,20,0
-
5,5,5
-
5,20,1
D
Correct answer
Explanation
x = 5. x<<2 (left shift by 2) = 5 * 4 = 20. x>>2 (right shift by 2) = 5 / 4 = 1 (integer division). Output: 5,20,1. Left shift multiplies by 2^n, right shift divides by 2^n.
C
Correct answer
Explanation
The question is poorly framed - there's no single 'computer language of the Internet.' However, Java became historically significant for web applications due to platform independence and applets. BASIC and COBOL are older languages, Pascal is educational. The question likely expects 'Java' based on its web prominence.