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 technology
  1. Page.User.Identity

  2. Page.User.IsInRole

  3. Page.User.Name

  4. None of the Above

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

In ASP.NET, the Page.User.Identity object contains the authentication information for the current user, including their name. The User property exposes an IPrincipal interface, and its Identity property holds the IIdentity object with details like Name and IsAuthenticated. IsInRole is a method for checking role membership, not a container for user name.

Multiple choice technology web technology
  1. < allow >

  2. < deny >

  3. Both A) and B)

  4. None of the Above

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

The section in ASP.NET configuration contains both and elements for controlling access rules. These elements define which users or roles are permitted or denied access to specific resources. Both elements work together to create comprehensive authorization rules.

Multiple choice technology web technology
  1. Load ( )

  2. Fill( )

  3. DataList

  4. DataBind

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

The Fill() method is used to populate a DataSet with data from a data source in ADO.NET. It executes the query and retrieves rows into the DataSet. Load() is not a standard DataAdapter method, DataList is a UI control, and DataBind is for web controls.

Multiple choice technology programming languages
  1. RowUpdating, AfterUpdate

  2. BeforeUpdate, RowUpdating

  3. RowUpdating, RowUpdated

  4. BeforeUpdate, AfterUpdate

  5. BeforeUpdate, RowUpdated

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

The DataAdapter in ADO.NET fires two events for each row during database updates: RowUpdating (before the update action) and RowUpdated (after the update completes). These events allow developers to intervene in the update process for validation, logging, or error handling. The prefix 'Row' is consistent for both events.

Multiple choice technology programming languages
  1. Application.Exit();

  2. System.Environment.Exit(0)

  3. System.Environment.Exit(1)

  4. All the above

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

All listed methods can terminate a C# application. Application.Exit() informs all message loops to terminate, which is suitable for Windows Forms. System.Environment.Exit(0) and System.Environment.Exit(1) terminate the process immediately and return exit codes to the operating system, representing success and failure respectively.

Multiple choice technology programming languages
  1. ReadAllLine()

  2. ReadAllBytes()

  3. ReadAllTexts()

  4. WriteAllLine()

  5. WriteAllTexts()

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

In the C# System.IO.File class, ReadAllBytes() is a valid built-in method. The other options are incorrect because they use incorrect naming: the correct framework methods are plural ReadAllLines(), singular ReadAllText(), plural WriteAllLines(), and singular WriteAllText(). C# is case-sensitive and strict about method signatures.

Multiple choice technology web technology
  1. SQL Data Source

  2. XML Data Source

  3. Object.

  4. ODBC

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

ASP.NET 2.0 introduced SqlDataSource, XmlDataSource, and ObjectDataSource controls to simplify data binding. These were new declarative data source controls that eliminated much of the code required in previous versions. ODBC data sources existed prior to 2.0.

Multiple choice technology programming languages
  1. Data

  2. Message

  3. StackTrace

  4. Source

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

The StackTrace property provides a detailed call stack that shows the sequence of method calls that led to the exception, including the exact line numbers where the exception originated. This is precisely what a developer needs to locate the problematic code. The Message property only contains a description of the error, while Data contains arbitrary additional information, and Source indicates the application name - none provide the specific line location like StackTrace does.

Multiple choice technology mainframe
  1. a) Bit Mapping Support

  2. b) Basic Mapping Standard

  3. c) Basic Mapping Support

  4. d) None of the above

  5. e) Neither (a) nor (b)

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

Basic Mapping Support (BMS) is the CICS facility used to define screens via assembler-level macro instructions. Both option C (which names BMS) and option E (neither a nor b) are correct since options A and B are incorrect terms.

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

  2. Practice for Exclusive and Report Language

  3. Practical Extraction and Report Learning

  4. Practical Exclusive and Report Language

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

Perl is an acronym for 'Practical Extraction and Report Language'. This name reflects its original purpose for text processing, report generation, and system administration tasks.

Multiple choice technology programming languages
  1. name.length

  2. name.size

  3. size(name)

  4. length(name)

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

In Ruby, both length and size are valid methods to get the number of elements in an array. They are aliases and return the same result. Options C and D are incorrect because size(name) and length(name) are not valid Ruby syntax - these methods must be called on the array object itself, not with the array as an argument.

Multiple choice technology programming languages
  1. True

  2. False

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

In Ruby, the index method (also called find_index) returns the position of the first occurrence of the specified element in the array. For days.index("Saturday"), this would return 5 (zero-indexed) or 6 (one-indexed position), which is the correct way to find an element's index.

Multiple choice technology mainframe
  1. Structured

  2. Hierarchical

  3. Reporting

  4. onject oriented

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

Natural programming language features two execution modes: Structured and Reporting. Structured mode is designed for structured coding with strict syntax validation, while Reporting mode allows quick, flexible data extraction and generation of reports with fewer syntax restrictions.