0

programming languages Online Quiz - 242

Description: programming languages Online Quiz - 242
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Which keyword allocates the largest available volume for the dataset?

  1. CONTIG

  2. MXIG

  3. ROUND

  4. RLSE


Correct Option: B

What is the effect of evaluation of following expression? Select the one correct answer. ${(5*5) ne 25}

  1. true

  2. false

  3. 25

  4. The expression does not compile as ne is not a valid operator.


Correct Option: B

Which one of the following is used to print the dump of the abended job in an unformatted way?

  1. SYSOUT

  2. SYSABEND

  3. SYSUDUMP

  4. SYSMDUMP


Correct Option: D

What is the effect of evaluation of following expression? Select the one correct answer. ${'cat' gt 'cap'}

  1. true

  2. false

  3. catcap

  4. The expression does not compile as gt operator cannot be applied on strings.


Correct Option: A

AI Explanation

To answer this question, you need to understand the comparison operators in programming.

In the given expression, "gt" is a comparison operator that stands for "greater than". When comparing two strings using the "gt" operator, it checks if the first string is lexicographically greater than the second string.

In this case, the expression '${'cat' gt 'cap'}' will evaluate to true. This is because in lexicographical order, 'cat' comes after 'cap'. Therefore, the expression is true.

The correct answer is A) true.

Which one of the following keyword a PROC cannot have?

  1. EXEC

  2. SYSABEND

  3. JOBLIB

  4. SYSPRINT


Correct Option: C

How many numbers are printed, when the following JSTL code fragment is executed? Select the one correct answer. ${item} a)1 b)5 c)6 d)11

  1. 1

  2. 5

  3. 6

  4. 11


Correct Option: C

STEP1 EXEC PGM=P1 STEP2 EXEC PGM=P2,COND=EVEN STEP3 EXEC PGM=P3,COND=((8,LE,STEP1),ONLY) If the condition code of the step1 is 4 and the step2 was abended then which statement is correct.

  1. step1, step2 and step3 will execute

  2. only step1 and step3 will execute

  3. only step1 and step2 will execute

  4. only step1 will execute


Correct Option: A

AI Explanation

To determine which statement is correct, let's analyze the given JCL statements and their conditions.

STEP1 - EXEC PGM=P1 This step executes program P1.

STEP2 - EXEC PGM=P2, COND=EVEN This step executes program P2 only if the previous step's condition code is an even number.

STEP3 - EXEC PGM=P3, COND=((8,LE,STEP1),ONLY) This step executes program P3 only if the condition code of STEP1 is less than or equal to 8.

Given the conditions and the scenario provided:

  • The condition code of STEP1 is 4.
  • The step2 was abended.

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

Option A) step1, step2, and step3 will execute This option is correct because even though step2 was abended, step3 will still execute since the condition for step3 is based on the condition code of step1, which is 4 (less than or equal to 8).

Option B) only step1 and step3 will execute This option is incorrect because step2 is conditioned to execute if the condition code of step1 is even. Since the condition code of step1 is 4 (even), step2 should execute.

Option C) only step1 and step2 will execute This option is incorrect because step3 is conditioned to execute if the condition code of step1 is less than or equal to 8. Since the condition code of step1 is 4 (less than or equal to 8), step3 should execute.

Option D) only step1 will execute This option is incorrect because both step2 and step3 have conditions that allow them to execute based on the condition code of step1.

Therefore, the correct answer is Option A) step1, step2, and step3 will execute.

What gets printed when the following JSTL code fragment is executed? Select the one correct answer.


Correct Option: D

Which one of the following is used to pass input to the COBOL program?

  1. INPUT

  2. PARM

  3. SYSOUT

  4. COND


Correct Option: B

The JSTL code does not compile as attribute for if tag are not correct.

  1. true

  2. false

  3. Nothing gets printed.

  4. Error message printed


Correct Option: B

What should be the DD name if we use the IBM utility IEBGENER?

  1. SYSUT1

  2. SYSIN

  3. DD1

  4. SYSPRINT


Correct Option: A

What gets printed when the following JSTL code fragment is executed? Select the one correct answer.

  1. The JSTL code does not compile as an attribute for forEach tag is not correct.

  2. 0

  3. 2

  4. ABC

  5. Nothing gets printed as c.out statement does not get executed.


Correct Option: B

Which library will have the load modules of the IBM utilities?

  1. SYS1.LINKLIB

  2. SYS1.SOTREPROC

  3. SYS1.CATPROC

  4. SYS1.PROCLIB


Correct Option: A

How many numbers gets printed when the following JSTL code fragment is executed? Select the one correct answer.

  1. No number gets printed.

  2. One number gets printed.

  3. Two numbers gets printed.

  4. Three numbers gets printed.

  5. Four numbers gets printed.


Correct Option: B
Explanation:

To solve this question, the user needs to know the working of the JSTL choose tag and the conditions used in the when tags.

The code fragment defines a variable 'item' whose value is set to 2. The code then goes on to use the choose tag which is used for conditional processing. The choose tag contains multiple when tags. The when tags are evaluated in the order they are written, and the first condition that is true gets executed. If none of the conditions is true, the code in the otherwise tag is executed.

Looking at the code, the value of the 'item' variable is 2. The first condition in the when tags is "${item>0}" which is true for the given value of item. Therefore, the code inside the first when tag is executed which prints the number 1. The code doesn't go on to evaluate the other when tags because the first condition is true.

So, the answer is:

The Answer is: B. One number gets printed.

If DISP=(,CATLG) which is the correct one?

  1. DISP=NEW,CATLG,CATLG

  2. DISP=OLD,DELETE,CATLG

  3. DISP=NEW,CATLG,DELETE

  4. DISP=OLD,CATLG,CATLG


Correct Option: A

Which numbers gets printed when the following JSTL code fragment is executed? Select the two correct answers.

  1. 1

  2. 2

  3. 3

  4. 4

  5. abc


Correct Option: B,C

Which numbers gets printed when the following JSTL code fragment is executed? Select the two correct answers.

  1. 2

  2. 3

  3. 4

  4. abc


Correct Option: B,C

Which number gets printed when the following JSTL code fragment is executed? Select the one correct answers.

  1. 1

  2. 2

  3. 3

  4. 4

  5. abc


Correct Option: A

Which of these represent the correct path for the core JSTL library in JSTL version 1.1? Select the one correct answer.


Correct Option: A

AI Explanation

To answer this question, you need to understand the correct path for the core JSTL library in JSTL version 1.1.

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

Option A) http://java.sun.com/jsp/jstl/core - This option is correct. In JSTL version 1.1, the correct path for the core JSTL library is "http://java.sun.com/jsp/jstl/core".

Option B) http://java.sun.com/jsp/core - This option is incorrect. It does not represent the correct path for the core JSTL library in JSTL version 1.1.

Option C) http://java.sun.com/core - This option is incorrect. It does not represent the correct path for the core JSTL library in JSTL version 1.1.

Option D) http://java.sun.com/jsp/jstl1.1/core - This option is incorrect. It does not represent the correct path for the core JSTL library in JSTL version 1.1.

The correct answer is Option A) http://java.sun.com/jsp/jstl/core. This option represents the correct path for the core JSTL library in JSTL version 1.1.

  1. tagname

  2. name

  3. tag

  4. prefix


Correct Option: B
Explanation:

To solve this question, the user needs to know about JSP and the syntax for defining custom tags in JSP using a tag library descriptor file. Specifically, the user should be familiar with the elements used in the tag library descriptor file.

In this case, the JSP file is using a custom tag defined in a tag library descriptor file. The myTag element in the JSP file should be defined in the tag library descriptor file using the "name" attribute in the "tag" element.

Now, let's go through each option and determine which one is correct:

A. tagname: This is not a valid option for defining a custom tag in a tag library descriptor file.

B. name: This is the correct answer. The "name" attribute in the "tag" element is used to define the name of the custom tag being defined in the tag library descriptor file.

C. tag: The "tag" element is used to define a custom tag in the tag library descriptor file, but it does not specify the name of the tag.

D. prefix: The "prefix" attribute in the "taglib" element is used to specify the prefix used for the custom tag library in the JSP file, but it does not define the custom tag itself.

Therefore, the correct answer is:

The Answer is: B. name

- Hide questions