0

programming languages Online Quiz - 224

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

Assume @list contains (“1”, “2”, “3”, “4”, “5” ). What is the content of @list after the following statement splice (@list, -1, 1, “test1”. “test2”);

  1. (“1”, “2”, “3”, “4”, “test1”, “test2”)

  2. ( “2”, “3”, “4”, “test1”, “test2”)

  3. (“1”, “3”, “4”, “test1”, “test2”)

  4. (“1”, “test1”, test2”, “2”, “3”, “4” )


Correct Option: A

What argument to splice is equivalent to push (@array, @sublist) function call?

  1. splice (@array,0.0.@sublist);

  2. splice (@array, scalar(@array),0, @sublist);

  3. splice (@array, 1, 0, @sublist);

  4. None


Correct Option: B

If $string contains abcdefgh , what will the following call return? substr($string, -2, 2);

  1. abc

  2. efgh

  3. gh

  4. None


Correct Option: C

If $string contains abcdabcd , what will the following call return? index ($string, “cd”, 3);

  1. 6

  2. 4

  3. -1

  4. 3


Correct Option: A

Which operator can be used to access the first item in an array?

  1. shift

  2. start

  3. right$

  4. left$


Correct Option: A

Which statement will print the capital attribute of the $kansas object?

  1. print ("capital"=>$kansas);

  2. print {$kansas}=>(capital);

  3. print (capital)<={$kansas};

  4. print $kansas->{"capital"};


Correct Option: D

Which function can be used to make sure your program exits with a nonzero status even if there a standard error?

  1. hash

  2. noexit

  3. nozero

  4. die


Correct Option: D
  1. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INFILE(DD1) OUTDATASET(USERID.TEST.VSAM) /*

  2. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INFILE(DD1) OUTFILE(USERID.TEST.VSAM) /*

  3. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INDATASET(DD1) OUTDATASET(USERID.TEST.VSAM) /*

  4. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INDATASET(DD1) OUTFILE(USERID.TEST.VSAM) /*


Correct Option: A
Explanation:

To understand the syntax of the OBJECT parameter, we need to understand what is IDCAMS. IDCAMS stands for Access Method Services, and it is used to access VSAM data sets. The IMPORT statement is used to copy records from one VSAM data set to another.

The syntax of the OBJECT parameter is as follows:

IMPORT INFILE(input_ddname) OUTDATASET(output_dsname)

Here, the input_ddname is the DD statement that defines the input data set, and output_dsname is the data set name of the output VSAM data set.

Now, let's go through each option and determine which one has the correct syntax for the OBJECT parameter:

A. This option has the correct syntax for the OBJECT parameter. The input data set is defined by DD1, and the output data set is defined by USERID.TEST.VSAM.

B. This option has an incorrect syntax for the OBJECT parameter. The parameter should be OUTDATASET instead of OUTFILE.

C. This option has an incorrect syntax for the OBJECT parameter. The parameter should be INFILE instead of INDATASET, and OUTDATASET should be used instead of OUTFILE.

D. This option has an incorrect syntax for the OBJECT parameter. The parameter should be INFILE instead of INDATASET.

Therefore, the correct answer is: The Answer is A.

  1. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  2. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  3. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  4. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,


Correct Option: C

Which of the following is not applicable in LIKE parameter?

  1. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  2. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  3. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  4. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG, //SAMPLE DDDSN=MYLIB


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M Option B) //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M Option C) //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M Option D) //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG, //SAMPLE DDDSN=MYLIB

The LIKE parameter is used in JCL (Job Control Language) to create a new dataset that is similar to an existing dataset. It allows you to specify an existing dataset as a template for creating a new dataset with similar characteristics.

In this case, the correct answer is Option A. The LIKE parameter is not applicable in this option because there is no LIKE parameter specified in the DD statement:

//OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

Therefore, the correct answer is Option A.

  1. //STEP40 EXEC PGM=IDCAMS,REGION=2048K //SYSPRINT DD SYSOUT=* DEFINE CLUSTER (NAME(USERID.TEST.VSAM)- VOL(*)- TRK(1,2)- INDEXED- SPEED-

  2. //JSTY0020 EXEC PGM=IDCAMS,COND=(0,NE) //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD *

  3. //STEP20 EXEC PGM=IDCAMS,REGION=2048K //SYSPRINT DD SYSOUT=* DELETE USERID.TEST.VSAM' SET MAXCC = 0

  4. None of the above


Correct Option: B
  1. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre | SHR} } {SPHERE} {OUTDDname | ODD} (ddn {,ddn,...)

  2. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre ¦ SHR} } {SPHERE} {OUTDDname ¦ ODD} (ddn {,ddn,...)

  3. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre | SHR} } {SPHERE} {OUTDDname | EVEN} (ddn {,ddn,...)

  4. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre ¦ SHR} } {SPHERE} {OUTDDname ¦ EVEN} (ddn {,ddn,...)


Correct Option: B
  1. DSN SYSTEM(SSID) BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS)

  2. DSN SYSTEM(SSID) - BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS) -

  3. DSN SYSTEM(SSID) BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS) -

  4. None of the above


Correct Option: A
  1. True

  2. False


Correct Option: B
Explanation:

To solve this question, the user needs to know the basic concept of signed data types.

A signed data type is a data type that can represent both positive and negative numbers. This type of data is represented using a sign bit, which indicates whether the number is positive or negative.

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

A. True: This option is incorrect. The number of non-zero positive values and negative values in a signed data type is not equal. In a signed data type, one bit is reserved for the sign, which means there is one less bit for the magnitude. As a result, the range of positive values is one less than the range of negative values. For example, in a signed 8-bit data type, the range of positive values is 0 to 127, while the range of negative values is -1 to -128.

B. False: This option is correct. A signed data type does not have an equal number of non-zero positive and negative values available. As explained above, the range of positive values is one less than the range of negative values in a signed data type.

Therefore, the answer is: B. False.

  1. BigOlLongStringWithMeaninglessName

  2. $int

  3. bytes

  4. $1

  5. finalist


Correct Option: A,B,C,D,E
  1. public static void main()

  2. public static void main(String arg[])

  3. public void main(String [] arg))

  4. public static void main(String[] args))

  5. public static int main(String [] arg))


Correct Option: B,D
  1. Imports, package declaration, classes

  2. Classes, imports, package declarations

  3. Package declaration must come first; order for imports and class definitions is not

  4. Package declaration, imports, classes

  5. Imports must come first; order for package declaration and class definitions is not


Correct Option: D

Consider the following line of code: int x[] == new int[25]; After execution, which statement or statements are true?

  1. x[24] is 0

  2. x[24] is undefined

  3. x[25] is 0

  4. x[0] is null

  5. x.length is 25


Correct Option: A,E

How can you force garbage collection of an object in Java?

  1. Garbage collection cannot be forced

  2. Call System.gc()

  3. Call System.gc(), passing in a reference to the object to be garbage-collected

  4. Call Runtime.gc()

  5. Set all references to the object to new values (null, for example)


Correct Option: A
  1. It depends on the underlying hardware

  2. 0 through 28–1

  3. 0 through 216–1

  4. –27 through 27–1

  5. –215 through 215–1


Correct Option: D
- Hide questions