mf07.v1 - Last Name _ First Name _ McGill ID _ Make sure...

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

View Full Document Right Arrow Icon
Last Name _____________________________________ First Name _____________________________________ McGill ID ______________________________________ Make sure the version number is marked on your scantron sheet. This is Version 1 McGill University COMP 208 -- Computers in Engineering Mid-Term Examination Thursday, October 18, 2007 2:35 – 4:00 P. M. Faculty standard calculators allowed. Grading: Question Possible Points Your Grade 1-15 5 marks each 16 25 marks Total 100 Computers in Engineering 1 of 15 October 18, 2007 Midterm test Version 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Question 1 What is the role of IMPLICIT NONE in a FORTRAN program? a) It tells the compiler to not allow any implicit DO loops b) It forces the programmer to declare all variables c) It allows the programmer to create variables on the fly d) It does not serve any purpose and can be omitted: It is only a legacy from early versions of FORTRAN e) None of the above Question 2 What does the following program output? The symbol “#” is used to represent a blank in the output. program midterm implicit none write (*,1) "2+3=" , 5.0 , " but not",4.96 write (*,2) "2+3=" , 5.0 , " but not",4.96 1 format (A6,F3.1,A8,F3.2) 2 format (A6,F3.0,A5,F3.1) end program midterm a) ##2+3=5.0#but#not*** ##2+3=#5.#but#4.9 b) ##2+3=5.0#but#not*** ##2+3=#5.#but#5.0 c) ##2+3=5.0#but#not4.9 ##2+3=5.##but#4.9 d) ##2+3=5.0#but#not*** ##2+3=5.#but#4.9 e) ##2+3=5.0#but#not*** ##2+3=#5.t#not5.0 Computers in Engineering 2 of 15 October 18, 2007 Midterm test Version 1
Background image of page 2
Question 3 Consider the following Fortran construct. S is any block of statements. DO I = 1, 10, 2 S END DO Which of the following Fortran constructs is not equivalent to this one? a) I = 1 DO WHILE (I <= 10) S I = I + 2 END DO b) I = -1 DO I = I + 2 IF (I > 10) EXIT S END DO c) I = 1 DO IF (I > 10) EXIT S I = I + 2 END DO d) I = 1 DO IF (I <= 10) THEN S ELSE EXIT END IF I = I + 2 END DO e) None of the above Computers in Engineering 3 of 15 October 18, 2007 Midterm test Version 1
Background image of page 3

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

View Full DocumentRight Arrow Icon
Question 4 Suppose x is an integer variable and FLAG is a logical variable. Which of the following statements will always result in x being set to 17. a)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

mf07.v1 - Last Name _ First Name _ McGill ID _ Make sure...

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

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