midterm1_F07_key

# midterm1_F07_key - 1 PROGRAM HAND INTEGER A,B,C C Ask the...

This preview shows pages 1–2. Sign up to view the full content.

MAE-10 Midterm Examination I Fall 2007 Answer Key Short Answers - Make a subdirectory called unixstuff in the current working directory - Change to home directory - Display the first few lines of the file dog - Display the file mouse - Display the last few lines of the file lioin Problem 1 1. OK 2. OK 3. Values of assignment for both X and Y cannont be in the same line. 4. The identifier for program name cannot begin with a number. 5. OK 6. Both .EQ. needs to be replaced by .EQV., and the second .EQ. is missing a period. 7. .F. needs to be spelled out .FALSE. 8. OK 9. END IF is not necessary for single-line IF statements Problem 2 1. 0. 0.5 F T 2. 0 0 T T 3. 0 0 T T 4. 0.5 0. F F 5. 72. 4. 18.MRMAE-1Rules 6. T F T T 7. 4. 4. 5 8. 100.

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

View Full Document
9. 99. 10. 101. Problem 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. PROGRAM HAND INTEGER A,B,C C Ask the user for the 3 input integers A,B,C PRINT*, 'Enter three integers' READ*, A,B,C C Determine is the inputs make up a pair, a trio, or empty hand IF (A .EQ. B .AND. B .EQ. C) THEN PRINT*, 'Trio.' ELSE IF (A .EQ. B .OR. B .EQ. C .OR. A .EQ. C) THEN PRINT*, 'Pair.' ELSE PRINT*, 'Empty Hand.' END IF END 2. PROGRAM LOOP REAL I DO 10 I = 200., 199., -0.1 PRINT*, 'Hello there', I 10 CONTINUE END 3. PROGRAM NOMOD INTEGER X LOGICAL DIV23 C Ask the user for the input integer PRINT*, 'Enter an integer' READ*, X C Determine if the input is divisible by 23 DIV23 = X/23 .EQ. FLOAT(x)/23. C Output the result PRINT*, 'The integer', X, 'is divisible by 23:', DIV23 END...
View Full Document

## This note was uploaded on 08/31/2010 for the course ENGRMAE 10 taught by Professor Staff during the Spring '08 term at UC Irvine.

### Page1 / 2

midterm1_F07_key - 1 PROGRAM HAND INTEGER A,B,C C Ask the...

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

View Full Document
Ask a homework question - tutors are online