mw09-1.v1 - Make sure the version number is marked on your...

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

View Full Document Right Arrow Icon
Make sure the version number is marked on your scantron sheet. This version 1 McGill University COMP 208 -- Computers in Engineering Mid-Term Examination Tuesday, February 17, 2009 2:35 – 4:00 P. M. Faculty standard calculators allowed. Grading: Question Possible Points 1-10 3 marks each 11-15 4 marks each 16-25 5 marks each 26 5 bonus marks Total 100 Computers in Engineering 1 of 15 February 17, 2009 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 The following declaration could appear in a correct Fortran program: INTEGER :: two*four(2,4) a) true b) false Question 2 In a Von Neuman machine programs are in the memory stored together with data. a) true b) false. Question 3 Suppose a Fortran subroutine is declared with a single parameter called a. The program calls this subroutine with the argument x. a) x is an alias for the variable a b) x becomes the name of a new variable c) There is an error because the argument must have the same name as the parameter in the definition. Question 4 Suppose a program opens a file which is designated in the OPEN statement as UNIT = 13. If the programmer wants to write formatted output to the file, the FORMAT statement must have the label 13. (That is, it must be declared as 13 FORMAT (…)). a) true b) false Question 5 The following Fortran statement will print 123.45. write (*,"(f3.2)") 123.45 a) true b) false Computers in Engineering 2 of 15 February 17, 2009 Midterm test Version 1
Background image of page 2
Question 6 Suppose a file named hello.f90 contains program hello implicit none ! This is my first program write (*,*) "Hello World!" end program hello What will be the output of the following command? g77 -x f77 -ffree-form "hello.f90" -o "hello.exe " a) A file named hello.out b) A file named hello.exe c) The string “ Hello World!” (without the parentheses) d) The string “! This is my first program” (without the parentheses) e) A compiler error message Question 7 An array is: a) A group of variables with the same name and of the same types b) A collection of values of various types stored in adjacent memory locations c) A variable that contains multiple values of the same type d) A collection of variables, each with its own name but all of the same type Question 8 The binary number 1000001 represents the decimal number a) 64 b) 65 c) 128 d) 129 e) None of the above Computers in Engineering 3 of 15 February 17, 2009 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
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 01/15/2010 for the course COMP COMP 206 taught by Professor Vybihal during the Spring '04 term at McGill.

Page1 / 15

mw09-1.v1 - Make sure the version number is marked on your...

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