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
  1. Point

  2. Refresh

  3. Pset

  4. Open

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

In Visual Basic, forms have built-in methods like Refresh, Show, Hide, and Move. Point and Pset are graphics methods used for drawing on forms or picture boxes. Open is a file I/O statement used to access files, not a forms method. Therefore, Open is not a forms method.

Multiple choice
  1. Size

  2. Resize

  3. Sizechange

  4. Resizewindows

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

When a form is resized by the user or programmatically, Visual Basic triggers the Resize event. This event allows developers to execute code in response to size changes, such as repositioning controls or adjusting layouts. The other options (Size, Sizechange, Resizewindows) are not standard VB events.

Multiple choice
  1. Help mode

  2. Design mode

  3. Break mode

  4. Run mode

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

Visual Basic has three primary working modes: Design mode (for creating interface), Run mode (for executing the application), and Break mode (for debugging during execution). Help mode is not one of these operational states - it's just accessing documentation, not a working mode of the IDE itself.

Multiple choice
  1. Form10

  2. Forms

  3. Form1

  4. Form0

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

When you create a new project in Visual Basic, it automatically includes one form named Form1 by default. Additional forms can be added with names like Form2, Form3, etc., but Form1 is always the initial form. The other options (Form10, Forms, Form0) are not default VB naming conventions.

Multiple choice
  1. It means that the MSIL code cannot be JIT compiled by the CLR.

  2. It provides the JIT code prevention.

  3. In the stage of the verification process, the type safety is analysed after the declaration of the code.

  4. The code passes the type-safety check. The CLR accepts that code is both valid and type-safe and allows it to be executed or referenced.

  5. It makes the code typesafe.

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

This is correct as it means JIT compiled code validity is not confirmed.

Multiple choice
  1. It is a standard, GUIless, console Window.

  2. It is the standard .NET Windows executable file.

  3. It is the standard .NET class library, which can be dynamically linked.

  4. It is the standard class module, which is used as a container for compiled classes.

  5. It manages the namespace of the assembly code.

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

This is correct about Windows Executable assembly.

Multiple choice
  1. These occur when the environment you're programming in doesn't understand the code.

  2. These errors occur when the programme is running.

  3. An example is trying to access a file that doesn't exist.

  4. This happens when the code doesn't quite behave the way it was supposed to.

  5. These errors are responsible for robust code.

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

This is a correct statement as the Design errors are the outcome of bad coding practices.

Multiple choice
  1. In this execution, the multiple versions of the same assembly can be managed and executed.

  2. This execution has delivered the user from complications associated with DLL hell.

  3. It is possible in an executable assembly to express a dependence on a particular support assembly.

  4. It manage the execution process in dynamic assembly only.

  5. The multiple versions of the assembly can be encrypted.

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

This is incorrect because it can manage the execution process in any assembly.

Multiple choice
  1. The array can be redeclared implicitly.

  2. It makes the preservation of the data of the original array.

  3. It can be used to change an array from one data type to another.

  4. It can produce exception in the code.

  5. It produces the complexity problem in the code.

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

This is correct because the ability to keep expanding the array is needed.

Multiple choice
  1. It is used to declare the name of a module and introduces the definition of the variables.

  2. It is used to declare the name of an interface and introduces the definitions of the members.

  3. It declares the name, parameters, and code that defines a Function procedure.

  4. It declares the name, parameters and code that define a Sub procedure.

  5. It defines the name of the module and the variables.

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

This is correct and it includes the definition of the variables, properties, events and procedures that the module comprises.

Multiple choice
  1. using System.log

  2. using System.Diagnostics

  3. using System.Event

  4. None of these

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

The System.Diagnostics namespace in .NET Framework provides classes for event logging (EventLog, EventLogEntry, EventLogInstaller) and other diagnostics features like performance counters and process tracing. This namespace is the correct location for event log functionality.

Multiple choice
  1. Reference Parameters

  2. Output Parameters

  3. Aliases

  4. Both (1) and (2)

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

In languages like C#, both reference parameters (using ref) and output parameters (using out) allow a method to modify and return multiple values back to the calling code. Therefore, both options enable changing multiple values.

Multiple choice
  1. Is

  2. Of

  3. As

  4. In

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

'Of' is not a reserved keyword in C#. Is, As, and In are all contextual keywords/reserved words. 'Of' is only used in generic type constraints (where T : IEnumerable) but is not a standalone keyword.

Multiple choice
  1. namespace directive

  2. import keyword

  3. import construct

  4. the keyword ''Using�

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

C# uses the 'using' keyword to import namespaces. Option D shows 'the keyword 'Using' which is correct despite encoding artifacts. Namespace directives declare namespaces but don't import them. 'import' is not valid C# syntax.

Multiple choice
  1. First line

  2. Last Line

  3. Anywhere in the code

  4. None of these

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

OPTION EXPLICIT must be placed on the FIRST line of ASP code to force variable declaration. This directive affects the entire script and must appear before any executable code. Placing it elsewhere would be ineffective.