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 .net
  1. .asp

  2. .aspx

  3. .asp.vb

  4. .aspx.vb

  5. .asp.vb.net

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The web form interface file (the presentation layer with HTML and server controls) uses the .aspx extension. The code-behind file containing the Visual Basic logic would be .aspx.vb, but the question specifically asks for the interface file.

Multiple choice .net
  1. Visual Basic

  2. C#

  3. C++

  4. Both a and b.

  5. All of the above.

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

ASP.NET is a language-agnostic framework. Developers can write the code-behind files using C#, Visual Basic, or even C++/CLI. Since all these languages are supported by the .NET runtime, 'All of the above' is the correct choice.

Multiple choice asp
  1. ASP does not depend upon which browser the viewer is using.

  2. ASP code does not show up in the source code; thus, the code is protected

  3. ASP does not download with the page to the viewer.

  4. ASP can easily interact with a database.

  5. All of the above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

ASP offers multiple advantages: it's server-side so browser-agnostic (A), code executes on the server so source is hidden from browsers (B), it doesn't download to the client (C), and it has built-in database connectivity through ADO (D). All are valid advantages over client-side JavaScript, making 'All of the above' correct.

Multiple choice asp
  1. ASP

  2. JavaScript

  3. VBScript

  4. C++

  5. Perl

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

VBScript (Visual Basic Script) was the default and most commonly used scripting language for classic ASP. While ASP could also use JavaScript (JScript), VBScript was the primary language in most ASP documentation and examples. This was because VBScript integrated seamlessly with Microsoft's server architecture and was familiar to Visual Basic developers.

Multiple choice .net asp
  1. C-sharp

  2. VB

  3. C++

  4. a and b

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

ASP.NET supports multiple languages for server-side scripting. C# (C-sharp) and VB.NET (Visual Basic) are the two primary languages supported in ASP.NET. Option D states 'a and b' which correctly identifies both C# and VB as valid choices. C++ is not a native ASP.NET server-side language (though C++/CLI exists, it's not standard for ASP.NET development).

Multiple choice .net asp
  1. System.Data.Interfaces

  2. System.Data.Common

  3. System.Data

  4. System.Data.Connection

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The IDbConnection interface is defined in the System.Data namespace. System.Data is the core namespace for ADO.NET interfaces including IDbConnection, IDbCommand, IDataAdapter, and IDataReader. System.Data.Common contains base classes like DbConnection that implement these interfaces.

Multiple choice .net c-sharp
  1. call

  2. this

  3. do

  4. that

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In C#, the variable named "this" is used to refer to the current object whose method is being invoked.

Now, let's go through each option and explain why it is right or wrong:

A. call: This option is incorrect because "call" is not the variable used to refer to the current object in C#.

B. this: This option is correct. In C#, "this" is used as a reference to the current object. It allows you to access members of the current instance within a method or constructor.

C. do: This option is incorrect because "do" is not the variable used to refer to the current object in C#.

D. that: This option is incorrect because "that" is not the variable used to refer to the current object in C#.

Therefore, the correct answer is B. this.

Let me know if you have any other questions or if there's anything else I can assist you with!

Multiple choice .net c-sharp
  1. Try

  2. Catch

  3. Exception

  4. Event

  5. System

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In .NET and Java, the base class for all exceptions is named Exception. Try and Catch are keywords used for handling exceptions, not classes for derivation. Event and System are related to the broader framework but do not serve as the specific base for exception objects.

Multiple choice .net c-sharp
  1. finds the first occurrence of each letter in the string

  2. searches for the first occurrence of any of the characters in the string

  3. will search for the first occurrence of the sequence of characters

  4. generates an error

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The IndexOfAny method searches a string for the first occurrence of ANY character from a specified character array. It returns the index of the first match found, not separate searches for each character or searching for a sequence.

Multiple choice .net c-sharp
  1. they represent the same meory location

  2. the are two different objects

  3. if one changes, so will the other

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

StringBuilder objects are reference types - even if two instances contain the same string content, they are separate objects in memory. Changing one StringBuilder does not affect the other because they point to different memory locations. Only value types or interned strings might share memory.

Multiple choice computer
  1. Brewed delicious coffee.

  2. Operated as a handheld remote control.

  3. Connected a toaster to the Internet.

  4. Calculated spreadsheets in a palmtop computer.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java was originally developed by James Gosling at Sun Microsystems as part of the 'Green Project.' Its first practical application was for the Star7, a handheld personal digital assistant (PDA) with a touchscreen that functioned as an advanced remote control.

Multiple choice html
  1. ASP

  2. PHP

  3. Perl CGI

  4. JSP

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To determine the most widely used email form script, we need to consider the popularity and usage of different programming languages for web development.

Now, let's go through each option and evaluate its suitability for creating email form scripts:

A. ASP (Active Server Pages): ASP is a server-side scripting language developed by Microsoft. While it is capable of handling email form scripts, it is not the most widely used option compared to other languages.

B. PHP (Hypertext Preprocessor): PHP is a popular server-side scripting language that is widely used for web development. It has built-in functions and libraries for handling email form scripts, making it a common choice for developers. PHP is known for its ease of use, flexibility, and extensive community support. Therefore, option B is the most likely correct answer.

C. Perl CGI (Common Gateway Interface): Perl CGI is a scripting language often used for web development. While it is capable of handling email form scripts, it is not as widely used as PHP.

D. JSP (JavaServer Pages): JSP is a technology used for developing web applications using Java. Although JSP can handle email form scripts, it is not as commonly used as PHP in web development.

Based on the popularity and usage of different programming languages for web development, the most widely used email form script is PHP (option B).

The Answer is: B. PHP

Multiple choice javascript
  1. response.write("Hello World")

  2. document.write("Hello World")

  3. ("Hello World")

  4. echo("Hello World")

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In client-side JavaScript, the correct method to write output to the HTML document is document.write(). The response.write() method is used in server-side ASP/VBScript, not JavaScript. Parentheses alone don't output anything, and echo() is a PHP construct, not JavaScript.

Multiple choice javascript
  1. onmouseover and onmousedown

  2. onmousedown and onmouseout

  3. onmousedown and onmouseup

  4. onmouseup and onmouseout

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To determine the correct answer, the user needs to understand the events associated with the onclick event in JavaScript.

The onclick event occurs when an element is clicked by the user. It is triggered when the mouse button is pressed down (onmousedown event) and then released (onmouseup event) while the cursor is still within the boundaries of the element. Therefore, the correct answer should include both onmousedown and onmouseup events in sequence.

Let's go through each option and explain why it is right or wrong:

A. onmouseover and onmousedown: This option is incorrect because it includes the onmouseover event, which is not part of the sequence for the onclick event. The onmouseover event is triggered when the mouse pointer enters the boundaries of an element, but it is not required for the onclick event to occur.

B. onmousedown and onmouseout: This option is incorrect because it includes the onmouseout event, which is not part of the sequence for the onclick event. The onmouseout event is triggered when the mouse pointer leaves the boundaries of an element, but it is not required for the onclick event to occur.

C. onmousedown and onmouseup: This option is correct. The onmousedown event is triggered when the mouse button is pressed down, and the onmouseup event is triggered when the mouse button is released. These two events occur in sequence when the onclick event is triggered.

D. onmouseup and onmouseout: This option is incorrect because it includes the onmouseout event, which is not part of the sequence for the onclick event. The onmouseout event is triggered when the mouse pointer leaves the boundaries of an element, but it is not required for the onclick event to occur.

Therefore, the correct answer is:

The Answer is: C. onmousedown and onmouseup