0

programming languages Online Quiz - 234

Description: programming languages Online Quiz - 234
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. (a) coded character set identifier

  2. (b) character code set identifier

  3. (c) codepage character set identifier

  4. (d) coded character statement identifier


Correct Option: A
  1. (a) Basis

  2. (b) Copy

  3. (c) Replace

  4. (d) All of the above


Correct Option: D
Explanation:

To understand which statement requires the LIB compiler option, one must know what the LIB compiler option does. The LIB compiler option specifies the name of the library file to be used during the linking phase of the build process. The library file contains precompiled object code that can be linked to the program being built.

Now, let's go through each option and determine whether it requires the LIB compiler option or not:

A. (a) Basis: This statement does not require the LIB compiler option because it does not involve linking precompiled object code from a library file.

B. (b) Copy: This statement does not require the LIB compiler option because it does not involve linking precompiled object code from a library file.

C. (c) Replace: This statement requires the LIB compiler option because it involves linking precompiled object code from a library file. The library file specified in the LIB option will be used during the linking phase of the build process.

D. (d) All of the above: Since option C requires the LIB compiler option, the correct answer is D, i.e., all of the above.

Therefore, the answer is: D.

  1. (a) Identification division

  2. (b) Data division

  3. (c) Environment division

  4. (d) Program division


Correct Option: B
  1. True

  2. False


Correct Option: A
Explanation:

To answer this question, the user needs to know about the concept of passing arguments between programs or functions.

The statement is true. If you pass fewer arguments than the number of data-names in the called program's identifier list, then the called program will not have enough information to complete its task, which can cause errors.

On the other hand, if you pass more arguments than the number of data-names in the identifier list, then some of the values will not have a place to go, which can also cause errors.

Therefore, the correct answer is:

The Answer is: A. True

  1. (a) By Reference

  2. (b) By Content

  3. (c) By Value

  4. (d) All of the above


Correct Option: D
Explanation:

To pass data between programs, there are different ways, and each method has its own pros and cons. The user needs to know the different ways to pass data between programs.

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

A. (a) By Reference: This option is one of the ways to pass data between programs. In this method, the address of the data (a pointer) is passed to the receiving program, and the receiving program accesses the data through the pointer. This method is efficient in terms of memory usage, but it requires extra care to ensure that the data remains valid and unchanged during the transfer.

B. (b) By Content: This option is not a common way to pass data between programs. In this method, the data is encapsulated in a message or a file, and the message or file is passed to the receiving program. This method can be used when the data is too large to pass as a parameter, or when the data needs to be persisted.

C. (c) By Value: This option is another way to pass data between programs. In this method, a copy of the data is passed to the receiving program. This method is simple and easy to implement, but it can be inefficient when dealing with large data sets.

D. (d) All of the above: This option is correct as all the three options mentioned above - by reference, by content, and by value - are valid ways to pass data between programs, and each method has its own advantages and disadvantages. The choice of the method depends on the specific requirements of the programs involved in the data exchange.

The Answer is: D

To pass a copy of the identifier to the subprogram --- code can be used?

  1. (a) CALL . . . BY CONTENT literal

  2. (b) CALL . . . BY CONTENT identifier

  3. (c) CALL . . . BY CONTENT ADDRESS OF identifier

  4. (d) CALL . . . BY CONTENT ADDRESS OF identifier


Correct Option: B
Explanation:

To solve this question, the user needs to know the different ways to pass parameters to a subprogram in programming languages.

The options in the question are using the "CALL" statement to pass a copy of the identifier to a subprogram. The CALL statement is used to transfer control to a subprogram (procedure or function) and pass arguments, if any.

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

A. (a) CALL . . . BY CONTENT literal: This option is incorrect because it passes a literal value to the subprogram, not an identifier. The "BY CONTENT" phrase specifies that the value is passed by value, which means a copy of the value is passed to the subprogram.

B. (b) CALL . . . BY CONTENT identifier: This option is correct because it passes a copy of the identifier (variable name) to the subprogram. The "BY CONTENT" phrase specifies that the value of the identifier is passed by value, which means a copy of the value is passed to the subprogram.

C. (c) CALL . . . BY CONTENT ADDRESS OF identifier: This option is incorrect because it passes the address of the identifier to the subprogram, not a copy of the value. The "BY CONTENT ADDRESS OF" phrase specifies that the address of the identifier is passed by value, which means a copy of the address is passed to the subprogram.

D. (d) CALL . . . BY CONTENT ADDRESS OF identifier: This option is incorrect because it is the same as option C, which passes the address of the identifier to the subprogram.

Therefore, the correct answer is:

The Answer is: B. (b) CALL . . . BY CONTENT identifier

To call a C/C++ function with a function return value

  1. (a) CALL . . . RETURNING

  2. (b) CALL . . . RECURRING

  3. (c) CALL . . . RECURSIVE

  4. (d) CALL . . . REFERRING


Correct Option: A

AI Explanation

To call a C/C++ function with a function return value, the correct option is A) (a) CALL . . . RETURNING.

Explanation: In C/C++, when you want to call a function and use its return value, you can use the syntax:

return_type variable = function_name(arguments);

For example, if you have a function named add that takes two integers as arguments and returns their sum, you can call it and store the result in a variable like this:

int result = add(3, 5);

In this case, the function add is called with the arguments 3 and 5, and the return value is assigned to the variable result.

Therefore, the correct option is A) (a) CALL . . . RETURNING.

We need to use ----- to get a sorted cross-reference listing

  1. (a) XNOX

  2. (b) XREFER

  3. (c) XSCR

  4. (d) XREF


Correct Option: D

AI Explanation

To get a sorted cross-reference listing, we need to use the utility program called XREF.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) XNOX - This option is incorrect because XNOX is not the correct utility program for a cross-reference listing.

Option B) (b) XREFER - This option is incorrect because XREFER is not the correct utility program for a cross-reference listing.

Option C) (c) XSCR - This option is incorrect because XSCR is not the correct utility program for a cross-reference listing.

Option D) (d) XREF - This option is correct because XREF is the utility program that is used to get a sorted cross-reference listing.

The correct answer is Option D. This option is correct because XREF is the utility program that is specifically designed to generate a sorted cross-reference listing.

The only difference between DECK and OBJECT is in the ------

  1. (a) linkage editor

  2. (b) dataset name

  3. (c) routing of datasets

  4. (d) binder


Correct Option: C

AI Explanation

To answer this question, we need to understand the difference between DECK and OBJECT in the context of computer programming or data processing.

DECK refers to a deck of punched cards, which was a common method of storing and processing data in early computer systems. The deck would contain a sequence of punched cards, each representing a specific instruction or data item.

OBJECT, on the other hand, refers to an executable file or program that has been compiled or assembled from the source code. The object file contains machine code instructions that can be directly executed by the computer.

The only difference between DECK and OBJECT is in the routing of datasets. In other words, DECK represents a dataset that contains a sequence of punched cards, while OBJECT represents a dataset that contains machine code instructions.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) linkage editor - This option is incorrect because the linkage editor is not related to the difference between DECK and OBJECT. The linkage editor is a program that resolves external references and combines multiple object files into a single executable program.

Option B) (b) dataset name - This option is incorrect because the dataset name does not differentiate between DECK and OBJECT. The dataset name is simply a label or identifier used to reference a specific dataset.

Option C) (c) routing of datasets - This option is correct because the routing of datasets is the only difference between DECK and OBJECT. DECK represents a dataset containing punched cards, while OBJECT represents a dataset containing machine code instructions.

Option D) (d) binder - This option is incorrect because the binder is not directly related to the difference between DECK and OBJECT. The binder is a program that combines multiple object files and libraries into a single executable program or module.

The correct answer is C) (c) routing of datasets. This option is correct because the only difference between DECK and OBJECT is in the routing of datasets, with DECK representing punched cards and OBJECT representing machine code instructions.

  1. (a) 1024

  2. (b) 4024

  3. (c) 256

  4. (d) 4096


Correct Option: D
  1. (a) the option specified last

  2. (b) the option specified first

  3. (c) both options takes effect

  4. (d) both options will not takes effect


Correct Option: A

In the syntax WORD(xxxx) what do xxxx specifies?

  1. (a) starting characters of the name of the reserved-word table

  2. (b) ending characters of the name of the reserved-word table

  3. (c) alternate characters of the name of the reserved-word table

  4. (d) All of the above


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax of the WORD function.

The WORD function is used in COBOL programming language to check if a given word is a reserved word or not. The syntax of the WORD function is:

WORD(word-to-be-checked, length-of-word-to-be-checked)

The xxxx in the given syntax WORD(xxxx) specifies the word to be checked for being a reserved word.

Option A, B, and C are incorrect because they do not specify the correct explanation for xxxx in the syntax WORD(xxxx).

Option D is incorrect because only option A is partially correct and option B and C are incorrect.

Therefore, the correct answer is:

The Answer is: A

Can we use the LANGUAGE compiler option and the NATLANG runtime option to act independently of each other.

  1. True

  2. False


Correct Option: A
Explanation:

To solve this question, the user needs to understand what the LANGUAGE compiler option and the NATLANG runtime option do.

The LANGUAGE compiler option specifies the programming language used in the code, while the NATLANG runtime option specifies the natural language used in the input and output of the program.

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

A. True: This option is correct. The LANGUAGE compiler option and the NATLANG runtime option are independent of each other. The compiler only needs to know the language being used to compile the code, while the NATLANG runtime option is used to determine the natural language used in input and output. These two options do not interact with each other and can be used independently.

B. False: This option is incorrect. The LANGUAGE compiler option and the NATLANG runtime option can be used independently of each other. They serve different purposes and do not depend on each other.

The Answer is: A

The DATA option affects whether storage for dynamic data areas and other dynamic runtime storage is obtained from above or below the ------line

  1. (a) 8MB

  2. (b) 31MB

  3. (c) 16MB

  4. (d) 20MB


Correct Option: C
Explanation:

To solve this question, the user needs to understand the concept of dynamic data areas and storage allocation in memory.

The DATA option in this context refers to a compiler option that affects where dynamic data areas and other runtime storage are allocated in memory. The option determines whether this storage is obtained from above or below a certain memory boundary called the "line."

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

A. (a) 8MB: This option is incorrect because it specifies a specific amount of memory rather than referring to the memory "line" mentioned in the question.

B. (b) 31MB: This option is incorrect because it specifies a specific amount of memory rather than referring to the memory "line" mentioned in the question.

C. (c) 16MB: This option is correct. The memory "line" referred to in the question is typically located at the 16MB boundary in memory. Therefore, the DATA option affects whether dynamic data areas and other runtime storage are obtained from above or below this 16MB line.

D. (d) 20MB: This option is incorrect because it specifies a specific amount of memory rather than referring to the memory "line" mentioned in the question.

The Answer is: C. (c) 16MB.

For conversions that lose precision - When a USAGE COMP-1 data item is moved to a FIXED-POINT data item that has more than nine digits, the fixed-point data item will receive only -- significant digits, and the remaining digits will be ----.

  1. (a) 18 , zero

  2. (b) zero , 18

  3. (c) zero , 9

  4. (d) 9 , zero


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of conversions that lose precision in COBOL.

In COBOL, the COMP-1 data type represents a single-precision floating-point number. It is typically used to store numbers with a decimal point and a fractional part. On the other hand, the FIXED-POINT data type represents a fixed-point number with a specified number of digits before and after the decimal point.

When a COMP-1 data item is moved to a FIXED-POINT data item that has more than nine digits, the fixed-point data item will receive only nine significant digits, and the remaining digits will be zero.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) 18, zero - This option is incorrect because the fixed-point data item receives only nine significant digits, not 18.

Option B) (b) zero, 18 - This option is incorrect because the fixed-point data item receives only nine significant digits, not 18.

Option C) (c) zero, 9 - This option is incorrect because the fixed-point data item receives only nine significant digits, not zero.

Option D) (d) 9, zero - This option is correct because the fixed-point data item receives only nine significant digits, and the remaining digits are zero.

Therefore, the correct answer is option D. The fixed-point data item will receive nine significant digits, and the remaining digits will be zero.

DBRM stands for ?

  1. (a) database request module

  2. (b) database resourse module

  3. (c) databind request module

  4. (d) databind resourse module


Correct Option: A

AI Explanation

To answer this question, you need to understand the acronym DBRM.

DBRM stands for Database Request Module.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) database request module - This option is correct because it accurately represents the acronym DBRM.

Option B) (b) database resource module - This option is incorrect because it does not accurately represent the acronym DBRM.

Option C) (c) databind request module - This option is incorrect because it does not accurately represent the acronym DBRM.

Option D) (d) databind resource module - This option is incorrect because it does not accurately represent the acronym DBRM.

The correct answer is A) (a) database request module. This option is correct because it accurately represents the acronym DBRM.

RMODE stands for ?

  1. (a) Remote mode

  2. (b) Regression mode

  3. (c) Recession mode

  4. (d) Residency mode


Correct Option: D

AI Explanation

To answer this question, we need to understand what RMODE stands for.

RMODE stands for Residency mode.

Option A) Remote mode - This option is incorrect because RMODE does not stand for Remote mode. Option B) Regression mode - This option is incorrect because RMODE does not stand for Regression mode. Option C) Recession mode - This option is incorrect because RMODE does not stand for Recession mode. Option D) Residency mode - This option is correct because RMODE stands for Residency mode.

Therefore, the correct answer is option D) Residency mode.

What is the clause we use to access the file between two programs as a common file ?

  1. (1) Use the SYNCHRONIZED clause for the file.

  2. (2) Use the EXTERNAL clause for the file.

  3. (3) Use GLOBAL clause for the file.

  4. (4) Use COMMON clause for the file.


Correct Option: B

AI Explanation

To access a file between two programs as a common file, we use the EXTERNAL clause for the file.

Let's go through each option to understand why it is correct or incorrect:

Option A) Use the SYNCHRONIZED clause for the file. This option is incorrect because the SYNCHRONIZED clause is used to ensure that only one program can access a file at a time, preventing concurrent access.

Option B) Use the EXTERNAL clause for the file. This option is correct because the EXTERNAL clause allows multiple programs to access a file as a common file. It allows sharing of data between programs.

Option C) Use the GLOBAL clause for the file. This option is incorrect because the GLOBAL clause is used to share data between programs within the same run unit, not between different programs.

Option D) Use the COMMON clause for the file. This option is incorrect because the COMMON clause is used to define shared variables within a program, not to access a file as a common file between programs.

The correct answer is Option B) Use the EXTERNAL clause for the file. This option is correct because it allows multiple programs to access the file as a common file.

- Hide questions