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

Multiple choice technology web 2.0
  1. "Hello World";

  2. echo "Hello World";

  3. Document.Write("Hello World");

  4. print("Hello World");

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web 2.0
  1. VBScript

  2. JavaScript

  3. Perl and C

  4. Java

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web 2.0
  1. <?php require("time.inc"); ?>

  2. <% include file="time.inc" %>

  3. <!--include file="time.inc"-->

  4. <?php include_file("time.inc"); ?>

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology web 2.0
  1. dbopen("localhost");

  2. mysql_open("localhost");

  3. mysql_connect("localhost")

  4. connect_mysql("localhost");

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. a low-level programming language.

  2. a compiled scripting language.

  3. an object-oriented scripting language.

  4. a scripting language precompiled in the browser.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. FileUpLoad

  2. Client

  3. Cursor

  4. Database

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Set dbMyDB = OpenDatabase

  2. Set dbMyDB = OpenDatabase("MyDatabase.mdb")

  3. dbMyDB = OpenDatabase("MyDatabase.mdb")

  4. None of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. The object module

  2. The class module

  3. The form module

  4. The global module

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Control Business-Oriented Language

  2. Common Business-Object Language

  3. Control Business-Object Language

  4. Common Business-Oriented Language

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Virtual Binary Language

  2. Video Basic

  3. Visual Basic

  4. Virtual Basic

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Large Progressive Proffesional

  2. List Processing Programming

  3. Large Processing Programming

  4. List Progressive Programming

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Practical Extraction and Recovery Language

  2. Proffesional Extraction and Recovery Language

  3. Proffesional Extraction and Report Language

  4. Practical Extraction and Report Language

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. StriNgent Object symBOlic Language

  2. Software Object symBOlic Language

  3. Software Oriented symBOlic Language

  4. StriNgent Oriented symBOlic Language

Reveal answer Fill a bubble to check yourself
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.