You are on page 1of 10
Seat No. Republic of the Philippine eG OPENSOURCE REE-RME REVIEW GROUP 4 https://web facebook,com/groups/ree.opensource OPENSOURCE ELECTRICAL ENGINEERING DIVISION COMPUTER FUNDAMENTALS 1 ACCESS POINT 1. Where is the error in the following FORTRAN program? 670 READ L,M.N 680 DATA 33 40 60 690 PRINT L+M/N 700 PRINT L*N+M 800 END A. line 670 C. line 690 B. line 680 D. line 700 2. What is the output of the following FORTRAN program? 100 DATA ‘June’,15,1955, 200 READ N$ 300 DATA 1948 400 READ C,X,X1 500 PRINT X;,NS,X,C A. 15,1955, June, 1955 C. 1948 June 1955 15 B, June 15 1955 1948 D. 1948 June 15 1955 3. Determine the output of the given program 10 FOR X=-1 TO 8 STEP 3 20 $=0 30 FOR Y=0 TO 4 STEP 2 40 S-S#X°YH1 50 NEXT Y 60 PRINTS 70 NEXT X 80 END A. -5 15 18 24 C. 017 23 84 B. -315 33 51 D. 7212.21 28 OSPB ver 3.4.1 4, In the given program, what is the value assigned to N? 10 N=0 15 GOTO 50 20 FOR X=-1 TO7 25 N=6 30 FOR Y=3 TO6 35 N=X*Y+16 40 NEXT Y 45 NEXT X 50 PRINT N 55 END A, -3678 0 B. -356 D. 98 5. What are the respective values of A,, A;, and As, given the following assignments? AvINT(S) A,sINT(10.4) 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 A382 C.65 B.4.5 D.7.2 7. What would be the output of the following FORTRAN program? 10 DEF FNA(K,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 A615 C.9-11 B. 8,3 D. 11-9 8. Convert AE Hex to Binary A. 1010 1110 ©. 1110 1010 A. 1010 1111 D. 1111 1010 9. first computer designed and primarily used to calculate artillery firing tables for the United States Army's Ballistic Research Laboratory In 1945. A. ENIAGY C. CHATGPT 8. EDIT D. MARK 1 10.If table Y represents an array, and B is 2, what is the value of ¥(B+2)? It table Y 1 90 2 -20 3 410 4 70 5 7 A. -22 C.17 B.-18 D.70 11. Why is the following expression NOT acceptable as a FORTRAN integer constant? 237,100 A. The first character must be a letter. C. There is no decimal point. B. There are more than six characters. D. It contains a comma. 12,Which of the following are acceptable as FORTRAN integer variables? |. NINA ILA#10 IIL INTEGER Iv. 2813 V. A160 A. Lonly C. Land Ill B.landV D.1, Ill, and V 13. Which of the following is NOT acceptable as a FORTRAN integer variable name? A. IRISH C. MAPLE B. KOST D. INSERTS 14. Which of the following are NOT acceptable as FORTRAN integer constants? 1. 5000 W414 IL A1S IV. 16.52 V. +999 A. land Il C. Ill and IV B. Hand Ill Dw, Ill, IV, and V 15. Which of the following are NOT acceptable as FORTRAN real constant names? APPLE |. LAMB III, 4ABC IV. WATER V. TREE A. land Ill C.1, Il, and Ill B. IV and V D. I, Ill, and V 16, What is a correct declaration form for the logical variable AZ? A. AZ=.TRUE C.AZ=1 B.AZ=1 D. AZ="TRUE" 17. Which of the following is NOT acceptable as a FORTRAN statement? C.AB=C'D D. A*B=C*D 18. Which of the following is NOT acceptable as a FORTRAN statement? C. AB=C'’D D. A*B=C*D 19. What value would the computer assign to the FORTRAN variable D8=1,0E8-1,5E6? A. -0.5 x 10? C. 9,85 x 10" B. 1.5.x 10? D. 10,5 x 10” 20.Which of the following is a valid FORTRAN statement for the algebraic expres- sion below? 3x? - 5x yt A. 3.0*X**2.0-5.0*X/Y2.0+1.0 B. (3.0X"*2.0-5.0X)/Y*2.0+1.0 . (3.0°X**2.0-5.0°X)/(Y"2.041.0) D. (3.0°X**2.0-5.0X)/(¥"*2.0+1.0) 21. How would the algebraic expression below be written in FORTRAN? (1+ xlyy A, (1.0#X/Y)"(%-1.0) C. (1,04X/Y)**(X-1.0) B. (1.0+X)/Y"*(X-1.0) D. (1.0+X/Y)"*X-1.0 22.Which of these FORTRAN format specifications reads the input -567610 as -5676.10? A.F6.2 C.F7.3 B.F7.2 D. F8.2 23.In a spreadsheet, the number in cell A2 is set to 2. Then cell B2 is set to A2*4/SA$2, where $ indicates the absolute cell address. This formula is copied into cells C2 and D2. The number shown in cell D2 is A2 c.8 B.4 D.16 24.What should be the READ and FORMAT statements for this data output? input data 315.66 A READ(5,20) C. — READ(S5,20)S 20. FORMAT(16) FORMAT(F6.2) B. READ(5,20)S D. READ(5,30)S 20 FORMAT(F6.2) 20 FORMAT(F6.2) 25.Which of the following is the correct WRITE statement to print the even numbers from 2 to 40, assuming conventional output device reference numbers? A. WRITE(6,8) (I-1,40,2) C. — WRITE(6,8) (1=2,40,2) 8 FORMAT (2012) 8 FORMAT(2012) B. — WRITE(5,8) (I=2,40,2) D. — WRITE(6,8) (I=2,40,2) 8 FORMAT (2012) 6 FORMAT(2012) 26.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,C,K 98 — FORMAT(2F7.4,212,F6.2,13) 1.4592 cde A B. B=14.5307 D. K=134 27.Which of the following is a correct IF statement? A. IF(.GE.5) GO TO7 C.IF (1.GE.5) B. IF (I,GE,5) GO TO7 D. IF (I.GE.5) GO TO7 28. What value is assigned to Q in this program? R=18.0 0 0 Q=RIS*T-T IF Q 10,20,30 10 Q=10 15 GOTO4O 20 Q=100 25 GOTO40 30 Q=1000 40 END AAS c. 100 B.10 D. 1000, 29,Which of the following DO statements counts J from 1 to 11 in increments of 27 A.DO5 J=1,2,11 B. DOS, J=1,11,2 D. DO 5 J=1,11,2 30.Which of these expressions for a one-dimensional array, A, is acceptable? Assume B, H, |, J, K, and L are greater than zero. A.A(LK) C. A(2*L+1) B.A(H+J) D.A(-3) 31. What is wrong with this program? DO 201=1,5 A()=5.8 155 20 CONTINUE A. Acannot be a real number. B. | cannot be an integer. C. There is an excess comma in the DO statement. D. The value of | cannot be changed in the DO loop. 32. Which is the correct DIMENSION statement for a 9 x 9 matrix, A, and a vector, B, with nine elements? A. DIMENSION A(9.9),8(9) C. DIMENSION A(9,9),B(9) B. DIM A(9,9),B(9) D. DIMENSION, A(9,9),8(9) 33.A 2 x 2 matrix, Z, is loaded from a DATA statement in the following order: 1.0, 10.0, 7.0, 20.0. List the matrix elements of Zin order of descending data magnitude, A. Z(1,1), 2(1,2), 2(2,1), 2(2,2) ©. 2(1,1), Z(2,1), 2(1,2), Z(2,2) B.Z(2,2), 2(1,1), 2(1,2), 2(2,1) D. Z(2,2), Z(1,1), 2(2,1), 2(1,2) 34. Find the values of X and Y after this program segment has been performed X=2 A. X=2, Y=4 B. X=4, Y=4 35.What is the value of A after this program segment is performed? A=0 DO 77 I= 77 A=A+l A4 c.8 B.5 D.10 36. Matt is downloading an 800 kB file from the internet using his 28.8k modem. How long will it take him to finish downloading? A.0.46 min C.3.8 min B. 3.7 min D.4.4 min 37. Find the value of J after executing the following program. I= J0 15 JosM*241*2 IF (EQ.3) GO TO 16 leit GOTO 15 16 CONTINUE Ag c.34 B.15 D.40 38. Which of the following sets of statements gives a value for ISUM different from the others? A ISUM-O c. ISUM=0 DO 10 I-1,5 ISUM=ISUM#+I*2-1 DO 10 =2,10,2 10 CONTINUE ISUM-ISUM+1 10 CONTINUE ISUM=ISUM-10 B ISUM=0 Dz ISUM=0 ISIG=1 DO 101 1,9,2 DO 20 1=1,9 ISUM=ISUM+1 IF (ISIG.EQ.-1) GO TO 10 10 CONTINUE ISUM=ISUM+1 10 ISIG=-ISIG 20. CONTINUE 39. Of the following, which is the only acceptable FORTRAN statement? A. DIMENSION Z(TEN) B. WRITE(6,101) (MATRIX(J,J=1,8)) C. READ(5,99) (TIME(X),X=1,10) D. READ(5,99) (TOTAL(N),N=1,20) 40. Given the following statements, EXTERNAL EXP A=0.0 R=FUNCT(A,EXP)+20.0 FUNCTION FUNCT(X,FX) FUNCT=FX(X) RETURN END A0.0 B.1.0 what is the value of R in the MAIN program? main program function definition C. 20.0 D.21.0 41. What is the purpose of the following program? DIMENSION KK(100) 10 KK(\)=I Do 60 DO 30 k=. NeJ*K 30. KK(N)=0 60 CONTINUE DO 80 I=1,100 7 ,50 IF (KK(I).£Q.0) GO TO 80 WRITE(5,101) KK(I) 101 FORMAT(3X,15) 80 CONTINUE A. to find a sum of the even numbers between 1 and 100 B. to find a sum of the odd numbers between 1 and 100 C. to find the prime numbers between 1 and 100 D. to sort the numbers of KK(100) in descending order 42.|f A and B are false, and C is true, which of the following logical expressions will be true? A. NOT.C.AND.A B. B.AND.C.ORA C. NOT.(A.AND.B) D. .NOT.C 43.What are the values assigned to A and B in this subroutine? COMMON ALPHA,BETA. main program ALPHA=4.0 BETA=3.0 COMMON BA subroutine C.A-3.0, D. A=4.0, 44.Which of the following are true statements regarding user-defined functions? |. The function is more versatile than a subroutine as itis not limited to mathematical calculations. Il. The function is defined as a variable in the main program. Ill. The function may be used repeatedly and anywhere in the program A. lonly C. Land Ill B. land Il D. Mand Ill 45. Which of the following would have to be added to the main program as a result of the variable XINCH being changed to INCH? Before the change, the function is FUNCTION FOOT(XINCH) FOOT=XINCH/12.0 RETURN END A. a COMMON statement C. a DIMENSION specification B. a CALL statement D. a REAL variable declaration 46. Of the following statements, which is FALSE? A. The FORMAT statement may or may not be executed by the program. B. More than one STOP statement is permitted in a program. C. The arithmetic IF can only be used to evaluate an arithmetic expression. D. No FORMAT statement is required with unformatted READ or WRITE statements.

You might also like