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
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.
-
Top of stack
-
Bottom of stack
-
Middle of stack
-
None of the above
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.
-
Bottom of the stack
-
Top of the stack
-
Middle of the stack
-
None of the above
B
Correct answer
Explanation
When using REXX data stacks, the PULL instruction retrieves data from the top of the stack (LIFO by default, or FIFO depending on how the data was queued). It does not retrieve data from the middle or bottom of the stack.
-
EXPOSE
-
INTERPRET
-
TRACE
-
DEBUG
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.
-
PARSE PULL FORCE
-
PARSE PULL TERMINAL
-
PARSE EXTERNAL
-
Not possible
C
Correct answer
Explanation
PARSE PULL normally reads from the REXX data stack first. PARSE EXTERNAL bypasses the stack entirely and forces input directly from the terminal, regardless of queued data.
-
sharedObject.flush
-
sharedObject.write
-
sharedObject.in
-
sharedObject.open
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.
-
svcutil.exe
-
XSD.exe
-
WCFClientGenerationUtil.exe
-
All of the above
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.
-
DataContractSerializer
-
XML Serializer
-
All of the above
-
Binary serialization
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.
-
Procedures without EXPORT Keyword can be accessed by other modules within the program.
-
Procedures with EXPORT Keyword can be accessed ONLY by the module in which it resides.
-
Procedures can ONLY access local variables.
-
None of the Above
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.
-
RPG Cycle code is not inserted which will affect the performance.
-
RPG Cycle code is inserted which will affect the performance.
-
RPG Bike code is inserted which will not affect the performance.
-
None of the above.
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.
-
A subroutine can execute another subroutine, can contain another subroutine and shared by other programs.
-
A subroutine can execute another subroutine, cannot contain another subroutine and shared by other programs.
-
A subroutine can execute another subroutine, can contain another subroutine and is not shared by other programs.
-
A subroutine can execute another subroutine, cannot contain another subroutine and is not shared by other programs.
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.
-
/Copy, Subroutines and Arrays
-
/Copy, Procedures and Arrays
-
/Copy, Subrotines and Procedures
-
None of the above
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.
-
A structure that has the same data type
-
A Line which used the type declaration
-
A blank line in the print screen
-
none of the above
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.
-
Use statement CLEAR
-
Var = 0.
-
initialize var.
-
VALUE is INITIAL
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.
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.