FOR2 - CGS-2421 FORTRAN EXAM II TEST FORM CODE"A SPECIAL...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CGS-2421 FORTRAN EXAM II, TEST FORM CODE "A", SPECIAL CODE "05", FALL 2008 This exam is OPEN BOOK, OPEN NOTES, CLOSED NEIGHBOR. Cheaters will receive a ZERO on the exam. Be SURE to read all instructions. You will not receive any partial credit if the instructions are not correctly followed. All variables are of their default type unless otherwise specified. Read each question carefully before answering the question. Instructions for filling out your answer sheet: - Read the information on the back of the answer sheet. - Code the test form code letter (on the title line of this page) in the TEST FORM CODE field. You lose 5 points if you do not code this field. - Code the special code number (on the title line of this page) in the SPECIAL CODES field. - Write and code your name in the LAST NAME, FI, MI fields. - Write and code your UFID. THIS FIELD IS IMPORTANT! You lose 5 points if you do not code this field. - Code the answers to the questions below. The 10 multiple choice questions in this exam are worth 5 points each (50). Question 11-13 are worth a total of 50 points. In the CGS2421 grade system, you will get a separate grade for each part. The sum of the two grades will be your grade for this exam.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1. Below is a FORTRAN program. CHARACTER (15) :: STR WRITE (UNIT=STR,FMT='(A2,F7.2,F4.1)') 'ABCD', 245.228, 12. WRITE(*,*) STR END PROGRAM Which of the following is the resulting output? A. AB 245.2312.0 B. AB245.22812.0 C. ABC 245.23 12 D. ABCD 245.2212.0 E. ABCD245.228 12 2. What is the value of CH2 after evaluating the following expression? Assume CH1 = 'F' AND S = 'gators' . CH2 = CHAR(ICHAR(CH1) + ICHAR('1') - ICHAR(S(2:2)) + 13) A. '3' B. 'w' C. '#' D. 'G' E. ' ' 3. Consider the following FORTRAN program. INTEGER :: I, Y I = 1 CALL X(I) WRITE(*,*) Y(I) END PROGRAM SUBROUTINE X(J) INTEGER :: J, Y J = Y(2) + Y(J+1) CALL Z(J) END SUBROUTINE INTEGER FUNCTION Y(K) INTEGER :: K Y = K - 2 END FUNCTION SUBROUTINE Z(I) INTEGER :: I I = I + MOD(I,3) END SUBROUTINE Which of the following is the correct displayed output? A. -3 B. -2 C. 0 D. 1 E. 2
Background image of page 2
4. Consider the following program. INTEGER :: I=1, J=2, K=3, B(2) = (/1,0/) INTEGER :: A(2,4) = RESHAPE((/8,7,6,5,4,1,2,2/),(/2,4/)) WRITE(*,'(1X, 6I3)') A(I+1,J), A(B(K-2),J-1), B(B(K-1)+2)-2 END PROGRAM Which of the following is the correct displayed output? A. 6 4 0 B. 6 8 -1 C. 5 6 -2 D. 5 8 -2 E. 5 9 -1 5. Consider the following program. CHARACTER :: A*7, B(6)*1 INTEGER :: I A = 'Fortran' DO I = 1, 6 B(I) = CHAR(5 - I + ICHAR(A(I+1:I+1))) ENDDO WRITE(*,*) (B(I), I = 2, 4) END PROGRAM Which of the following is the correct displayed output? A. uvs B. ort C. Gat D. wxy E. z!@ 6. What is the output of the following FORTRAN program? REAL X, Y
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/30/2009 for the course CGS 2421 taught by Professor Onal during the Fall '09 term at University of Florida.

Page1 / 16

FOR2 - CGS-2421 FORTRAN EXAM II TEST FORM CODE"A SPECIAL...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online