Which of the following actions will NOT help increase the maintainability of a program?
A. Consolidating redundant code
B. Deleting dead code
C. Replacing subroutines with functions
D. Proper commenting for each piece of functionality
正解:C
質問 2:
Given the following code example, what is the value of A after the last CALL to ADD_RUT?
PGM2: PROC OPTIONS(MAIN,REENTRANT) REORDER;
DCL A BIN FIXED (15);
A =1
CALL ADD_RUT(A);
CALL ADD_RUT(A);
CALL ADD_RUT(A);
ADD_RUT:PROC (VAL);
DCL VAL DEC FIXED (15);
VAL = VAL + 1;
END ADD_RUT;
END PGM2;
A. 4
B. 1
C. 3
D. 2
正解:B
質問 3:
A member of the team points out to the lead developer that there appears to be an error in the program
the lead developer has created. Which of the following is the most appropriate response from the lead
developer?
A. Thank the programmer, saying the program will be checked but asking him to check that the error is
not in his program.
B. Thank the programmer, asking for details about the error and discussing the solution with him.
C. Thank the programmer, indicating the code will be revised and provided to the team for review.
D. Thank the programmer, indicating there is not time to correct the code and requesting that he do so.
正解:B
質問 4:
Given the following declaration, which code does NOT initialize C completely?
DCL 1 A,
2 B DIM (0:9),
3 C DIM (5) FIXED BIN (31),
3 D CHAR (100) VAR;
A. 3 C DIM (5) FIXED BIN(31) INIT ((50)1),
B. 3 C DIM (5) FIXED BIN(31) INIT ((5)1,(*)2),
C. 3 C DIM (5) FIXED BIN(31) INIT ((*)1),
D. 3 C DIM (5) FIXED BIN(31) INIT ((HSOUND(C,1))( 0)),
正解:D
質問 5:
In a multithreading environment, when can a deadlock occur between two threads, if at all?
A. When they have both locked a resource that the other one requires
B. When both access the same memory area
C. It can neveroccur.
D. When they are operating synchronously
正解:A
質問 6:
A program reads an input file into a structure with 20 fields. Fifteen of these are required as parameters in
an external procedure. Which of the following is the most efficient way of passing these parameters?
A. Create a structure, assign the 15 variables to it and pass the address of it in one argument.
B. Pass 15 variables in a parameter list.
C. Create a structure, assign the 15 variables to it and pass it as one argument.
D. Pass the address of the input structure as one argument.
正解:D
質問 7:
A programmer has submitted the following declaration for review. What feedback should be provided to
the programmer?
DCL 1 A,
2 B DIM (1000) FIXED BIN (31) INIT (0),
2 C DIM (1000) FIXED BIN(15) INIT (0);
A. Discuss with the programmer how many elements of the arrays need to be initialized.
B. A is incorrectly initialized and the code must be changed.
C. The declaration of A should be changed because the current declaration contains padding bytes.
D. The code is good as written.
正解:A
質問 8:
What could be used when a structure is passed to a subroutine to verify that the area the structure
occupies in storage has not been overwritten?
A. Structure is passed as an aggregate.
B. Structure has a length field at start.
C. Structure is passed as a pointer.
D. Structure has eyecatchers at start and at end.
正解:D
沢诗** -
読みやすく わかりやすい解説
これでC9050-042試験に受かる気がした。そっくりの問題がいくつかあって、助かりました。