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
-
"Hello World";
-
echo "Hello World";
-
Document.Write("Hello World");
-
print("Hello World");
B
Correct answer
Explanation
In PHP, the standard way to output text to the browser is using the echo language construct or the print function. While print("Hello World"); is also valid syntax, echo "Hello World"; is the widely accepted correct answer in basic PHP quizzes. Option 593320 lacks an output keyword, and Document.Write is JavaScript.
-
VBScript
-
JavaScript
-
Perl and C
-
Java
C
Correct answer
Explanation
PHP syntax is heavily influenced by C, Java, and Perl. Its control structures, variable sigils (like Perl's $), and basic block structures closely mirror Perl and C. JavaScript, Java, and VBScript are less direct syntactic ancestors despite some shared programming concepts.
-
<?php require("time.inc"); ?>
-
<% include file="time.inc" %>
-
<!--include file="time.inc"-->
-
<?php include_file("time.inc"); ?>
A
Correct answer
Explanation
In PHP, files are included using functions like require or include inside standard PHP tags. The correct option uses require("time.inc") inside `. The other options are incorrect: ASP syntax, HTML comment syntax, andinclude_file` (which is not a built-in PHP function).
-
$_GET[];
-
Request.QueryString;
-
Request.Form;
-
$_POST[];
A
Correct answer
Explanation
In PHP, the superglobal array $_GET is used to collect value data sent via an HTTP GET request. $_POST is for POST requests, while Request.QueryString and Request.Form belong to classic ASP / .NET syntax rather than PHP.
-
dbopen("localhost");
-
mysql_open("localhost");
-
mysql_connect("localhost")
-
connect_mysql("localhost");
C
Correct answer
Explanation
The correct way to connect to a MySQL database in PHP uses the mysql_connect() function. Option A's dbopen() doesn't exist, option B's mysql_open() is not a standard PHP function, and option D's connect_mysql() is also not a valid function.
-
a low-level programming language.
-
a compiled scripting language.
-
an object-oriented scripting language.
-
a scripting language precompiled in the browser.
D
Correct answer
Explanation
JavaScript is interpreted by the browser at runtime, making it a scripting language that's precompiled in the browser. Options A and B are incorrect as JavaScript is not low-level or compiled, and option C is wrong as while it has some object-oriented features, it's primarily a scripting language.
-
FileUpLoad
-
Client
-
Cursor
-
Database
A
Correct answer
Explanation
The FileUpLoad object is a client-side JavaScript object for handling file uploads in the browser. Options B, C, and D are incorrect as Client, Cursor, and Database are not standard client-side JavaScript objects for file handling.
-
The Java console
-
LiveConnect
-
LiveWire
-
LiveWire Pro
B
Correct answer
Explanation
LiveConnect is the technology that enables JavaScript to access methods and properties of Java applets. The Java console is not used for this purpose, and LiveWire/LiveWire Pro are different technologies not related to JavaScript-Java communication.
-
Set dbMyDB = OpenDatabase
-
Set dbMyDB = OpenDatabase("MyDatabase.mdb")
-
dbMyDB = OpenDatabase("MyDatabase.mdb")
-
None of these
B
Correct answer
Explanation
To open a database in VB, you need to use Set dbMyDB = OpenDatabase("MyDatabase.mdb") with both the Set statement and the database path parameter. The Set statement is required for object variables.
-
The object module
-
The class module
-
The form module
-
The global module
A
Correct answer
Explanation
The question asks which item is NOT a collection in VB project structure. Option A (object module) is marked correct, meaning it's not part of standard VB project collections. The standard VB project includes class modules, form modules, and global modules as collections. However, the terminology here is potentially confusing as object-oriented programming is central to VB.
-
Control Business-Oriented Language
-
Common Business-Object Language
-
Control Business-Object Language
-
Common Business-Oriented Language
D
Correct answer
Explanation
COBOL stands for Common Business-Oriented Language, a programming language designed for business applications. Option D is correct - it accurately expands the acronym. Options A, B, and C provide incorrect combinations of words that don't represent the actual meaning of COBOL.
-
Virtual Binary Language
-
Video Basic
-
Visual Basic
-
Virtual Basic
C
Correct answer
Explanation
VB stands for Visual Basic, which is a programming language developed by Microsoft. Option A is incorrect as VB is not related to 'Binary'. Option B is wrong because VB is not called 'Video Basic'. Option D is incorrect as it uses 'Virtual' instead of 'Visual'. The correct answer is C.
-
Large Progressive Proffesional
-
List Processing Programming
-
Large Processing Programming
-
List Progressive Programming
B
Correct answer
Explanation
LISP stands for List Processing Programming, a programming language designed for list processing. Option A is incorrect because it uses 'Large' and 'Professional' instead of 'List' and 'Processing'. Option C is wrong because it uses 'Large' instead of 'List'. Option D is incorrect as it uses 'Progressive' instead of 'Processing'. The correct answer is B.
-
Practical Extraction and Recovery Language
-
Proffesional Extraction and Recovery Language
-
Proffesional Extraction and Report Language
-
Practical Extraction and Report Language
D
Correct answer
Explanation
Perl stands for Practical Extraction and Report Language. Option A is incorrect because it uses 'Recovery' instead of 'Report'. Option B is wrong as it uses 'Professional' instead of 'Practical'. Option C is incorrect because it uses 'Professional' instead of 'Practical'. The correct answer is D.
-
StriNgent Object symBOlic Language
-
Software Object symBOlic Language
-
Software Oriented symBOlic Language
-
StriNgent Oriented symBOlic Language
D
Correct answer
Explanation
SNOBOL stands for StriNgent Oriented symBOlic Language, a string processing language. Option A is incorrect as it uses 'Object' instead of 'Oriented'. Option B is wrong because it uses 'Object' instead of 'Oriented'. Option C is incorrect as it uses 'Software' instead of 'StriNgent'. The correct answer is D.