問題一覧
1
Where is the error in the following FORTRAN program? 670 READ L,M,N 680 DATA 33 40 60 690 PRINT L+MIN 700 PRINT L*N+M 800 END (A) line 670 (B) line 680 (C) line 690 (D) line 700
B
2
What is the output of the following FORTRAN program? 100 DATA 'June', 15,1955 200 READ N$ 300 DATA 1948 400 READ C,XX, 500 PRINT XI,NS,X,C (A) 15,1955, June, 1955 (B) June 15 1955 1948 (C) 1948 June 1955 15 (D) 1948 June 15 1955
C
3
In the given program, what is the value assigned to N? 10 N=0 15 GO TO 50 20 FOR X=-1 TO 7 25 N=6 30 FOR Y=3 TO 6 35 N=X*Y+16 40 NEXT Y 45 NEXT X 50 PRINT N 55 END (A) -3678 (B) -356 (C) 0 (D) 98
C
4
Determine the output of the given program. 10 FOR X=-1 TO 8 STEP 3 20 S=0 30 FOR Y=0 TO 4 STEP 2 40 S=S+X*Y+1 50 NEXT Y 60 PRINT S 70 NEXT X 80 END (A) -5 15 18 24 (B) -3 15 33 51 (C) 0 17 23 84 (D) 72 12 21 28
B
5
What are the respective values of As, A2, and As, given the following assign- ments? A1=INT(5) A2=INT (10.4) A3=INT(-10.4) (A) A1 =5, A2=10, A3=-10 (B) A1=5, A2=11, A3=-10 (C) A1 =5, A2=10, A3=-11 (D) A1=5, A2=11, A3=-11
C
6
What would be the value printed as a result of the following instructions? 10 DEF FNA(X)=X**2+1/X 20 PRINT FNA(2) 30 END
4.5
7
What would be the output of the following FORTRAN program? 10 DEF FNA(X,Y)=X*2+X*3-X*Y 20 READ B(1),C,D 30 DATA 3.2.4 40 PRINT FNA(B(1),B(1)) 50 PRINT FNA(C/D. C*D) 60 END
6, -1.5
8
Why is the following expression NOT acceptable as a FORTRAN integer constant? 237, 100
It contains a comma.
9
Which of the following are acceptable as FORTRAN integer variables? I. NINA II. A+10 III. INTEGER IV. 2813 V. A160
I only
10
Which of the following is NOT acceptable as a FORTRAN integer variable name?
INSERTS
11
Which of the following are NOT acceptable as FORTRAN integer constants? I. 5000 II. -14 III. A15 IV. 16.52 V. +999
III and IV
12
Which of the following are NOT acceptable as FORTRAN real constant names? I. APPLE II. LAMB III. 4AB IV. WATER V. TREE
II and III
13
What is a correct declaration form for the logical variable AZ?
AZ=.TRUE.
14
Which of the following is NOT acceptable as a FORTRAN statement?
A*B=C*D
15
Which of these FORTRAN format specifications reads the input -567610 as -5676.10?
F8.2
16
What should be the READ and FORMAT statements for this data output? input data = 315.66
READ (5,20)S 20 FORMAT(F6.2)
17
Which of the following is the correct WRITE statement to print the even numbers from 2 to 40, assuming conventional output device reference numbers?
WRITE(6,8) (I=2,40,2) 8 FORMAT (20I2)
18
A data line is as follows: 21.459214.5307421557.82134524. Which of the following is an incorrect storage of this data using the following READ statement? READ(5,98)A,B,I,J,C,K 98 FORMAT (2F7.4,2I2,F6.2,I3)
K=134
19
Which of the following is a correct IF statement?
IF (I.GE.5) GO TO 7
20
Which of the following DO statements counts J from 1 to 11 in increments of 2?
DO 5 J=1,11,2
21
What is wrong with this program? DO 20 I=1,5 A(I)=5.8 I=5 20 CONTINUE
The value of I cannot be changed in the DO loop.
22
Which of these expressions for a one-dimensional array, A, is acceptable? Assume B, H, I, J, K, and L are greater than zero.
A(2*L-1)
23
Which is the correct DIMENSION statement for a 9 x9 matrix, A, and a vector, B, with nine elements?
DIMENSION A(9,9),B(9)
24
A 2 x 2 matrix, Z, is loaded from a DATA statement in the following order: 15.0, 10.0, 7.0, 20.0. List the matrix elements of 2 in order of descending data magnitude.
Z(2,2), Z(1,1), 2(2,1), 2(1,2)
25
What is the value of A after this program segment is performed? A=0 DO 77 I=1,4 77 A=A+I
10
26
Matt is downloading an 800 kB file from the internet using his 28.8k modem. How long will it take him to finish downloading?
3.8 min
27
Find the value of J after executing the following program. I=1 J=0 15 J=J**2+I**2 IF (I.EQ.3) GO TO 16 I=I41 GO TO 15 16 CONTINUE
34
28
Given the following statements, what is the value of R in the MAIN program? EXTERNAL EXP A=0.0 R=FUNCT(A,EXP)+20.0 FUNCTION FUNCT(X,FX) FUNCT=FX(X) RETURN END
21.0
29
Of the following, which is the only acceptable FORTRAN statement?
READ(5,99) (TOTAL(N),N=1,20)
30
If A and B are false, and C is true, which of the following logical expressions will be true?
NOT.(A.AND.B)
31
Which of the following are true statements regarding user-defined functions? I. The function is more versatile than a subroutine as it is not limited to mathematical calculations. II. The function is defined as a variable in the main program. III. The function may be used repeatedly and anywhere in the program
II and III