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 programming languages
  1. PARSE

  2. PULL

  3. PUSH

  4. STRING

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

The PARSE instruction in REXX is specifically designed for string manipulation and parsing. It can break strings into multiple variables using various templates (like PARSE VAR, PARSE VALUE, PARSE LINE, PARSE UPPER). The PARSE instruction with the 'X' suffix (like PARSE 'ABC'X) converts hexadecimal to character strings. Options B and C (PULL, PUSH) are stack operations, and STRING is not a REXX keyword.

Multiple choice technology programming languages
  1. Top of stack

  2. Bottom of stack

  3. Middle of stack

  4. None of the above

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

The PUSH instruction in REXX places data onto the top of the external data stack. This is a Last-In-First-Out (LIFO) structure where PUSH adds elements to the top, and PULL retrieves from the top. The stack grows upward, so new items are always placed 'on top' of existing items. Option B (bottom) and C (middle) are incorrect because PUSH always operates on the top of the stack.

Multiple choice technology programming languages
  1. EXPOSE

  2. INTERPRET

  3. TRACE

  4. DEBUG

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

The TRACE instruction in REXX is used for interactive debugging and program execution tracing. When TRACE is enabled (with options like TRACE ALL, TRACE RESULTS, TRACE INTERMEDIATE), REXX displays each instruction before execution and/or shows intermediate results, making it easier to debug logic errors and trace program flow. DEBUG is not a REXX keyword, and EXPOSE/INTERPRET serve other purposes.

Multiple choice technology programming languages
  1. sharedObject.flush

  2. sharedObject.write

  3. sharedObject.in

  4. sharedObject.open

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

The flush() method immediately writes shared object data to the local SOL file. The write() method does not exist for SharedObject, while open() and in() are not the standard methods for persisting data - open() establishes the connection and get() retrieves data.

Multiple choice technology architecture
  1. svcutil.exe

  2. XSD.exe

  3. WCFClientGenerationUtil.exe

  4. All of the above

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

svcutil.exe is indeed the standard Microsoft utility for generating WCF client proxies and configuration from service metadata. It reads service metadata (WSDL/XSD) and generates client code and configuration files. The other options are not WCF-specific client generation tools.

Multiple choice technology architecture
  1. DataContractSerializer

  2. XML Serializer

  3. All of the above

  4. Binary serialization

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

DataContractSerializer is the default and recommended serialization mechanism for WCF. It provides better performance than XMLSerializer and is opt-in rather than opt-out. While you can configure WCF to use XMLSerializer using the [XmlSerializerFormat] attribute, DataContractSerializer is the out-of-the-box default.

Multiple choice technology programming languages
  1. Procedures without EXPORT Keyword can be accessed by other modules within the program.

  2. Procedures with EXPORT Keyword can be accessed ONLY by the module in which it resides.

  3. Procedures can ONLY access local variables.

  4. None of the Above

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

Procedures without the EXPORT keyword are internal to the module and cannot be accessed by other modules, making option 1 incorrect. Procedures with EXPORT can be accessed by other modules, making option 2 incorrect. Procedures can access global variables, making option 3 incorrect. Thus, 'None of the Above' is correct.

Multiple choice technology programming languages
  1. RPG Cycle code is not inserted which will affect the performance.

  2. RPG Cycle code is inserted which will affect the performance.

  3. RPG Bike code is inserted which will not affect the performance.

  4. None of the above.

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

Calling a dynamic program (using CALL in RPG) does not compile or bind the called program at compile time. RPG Cycle code references and dynamic invocation details don't insert RPG Cycle code into the calling code in a performance-inhibiting way. 'None of the above' is correct.

Multiple choice technology programming languages
  1. A subroutine can execute another subroutine, can contain another subroutine and shared by other programs.

  2. A subroutine can execute another subroutine, cannot contain another subroutine and shared by other programs.

  3. A subroutine can execute another subroutine, can contain another subroutine and is not shared by other programs.

  4. A subroutine can execute another subroutine, cannot contain another subroutine and is not shared by other programs.

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

In RPG/400, subroutines cannot contain other subroutines - they must be defined at the main program level only. A subroutine can execute/call another subroutine (that's allowed), but it cannot define/contain a subroutine within itself. Subroutines are not shared across programs - they are internal to the program that defines them. Option D correctly states: can execute another subroutine, cannot contain another subroutine, and is not shared.

Multiple choice technology programming languages
  1. /Copy, Subroutines and Arrays

  2. /Copy, Procedures and Arrays

  3. /Copy, Subrotines and Procedures

  4. None of the above

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

Modular programming in AS/400 RPG uses three main techniques: /COPY compiler directives for including common source code, Subroutines for internal program modularization, and Procedures (also called subprocedures) which can be exported and shared across programs. Arrays (options A and B) are data structures, not modularization techniques. Option C correctly identifies /COPY, Subroutines, and Procedures as the modular programming techniques.

Multiple choice technology programming languages
  1. A structure that has the same data type

  2. A Line which used the type declaration

  3. A blank line in the print screen

  4. none of the above

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

The line type of an internal table defines the structure of each row - it specifies what data fields each row contains and their types. Option A correctly describes it as a structure with matching data types. The other options describe incorrect or unrelated concepts.

Multiple choice technology programming languages
  1. Use statement CLEAR

  2. Var = 0.

  3. initialize var.

  4. VALUE is INITIAL

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

CLEAR is the standard ABAP statement to reset a variable to its initial value regardless of its data type. Setting var = 0 only works for numeric variables, initialize var is syntactically invalid, and VALUE IS INITIAL is used in conditional expressions rather than assignments.

Multiple choice technology programming languages
  1. P

  2. F

  3. D

  4. I

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

In ABAP, when 'fixed point arithmetic' is set to true, it affects how packed numbers (type P) are handled. Packed numbers store decimal values with fixed precision, and the fixed point arithmetic setting determines how calculations and rounding are performed. The question asks which data type is affected, and the answer is P (packed number). Types F (floating point), D (date), and I (integer) are not affected by this setting.