FortranHW2 - distance to its destination. Write a program...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Aero 3970: Applications of FORTRAN Homework Assignment #2 Due: Monday February 28, 12:00 PM Syntax Questions 1. Unless you tell the program otherwise, all variables that start with the letters a-h and o-z will be _________, and all variables that start with the letters i-n will be _______. 2. (True/False) It is very important that the variable declarations be placed under the “program” command but before the main part of your code. (Multiple Choice) 3. What would the beginning of a do loop look like if you wanted to start at i = 100 and end at i = 2, counting by -2? a. do i = 100:-2:2 b. do i = 2:-2:100 c. do i = 100,-2,2 d. do i = 100,2,-2 4. The command to conclude a do loop is _______ and the command to conclude an if statement is ________. a. end; end b. end if; end do c. hold up; wait a minute d. end do; end if 5. The second to last line in a subroutine is always a. return b. stop c. end d. reverse Program Assignment There is a spaceship equipped with an engine that every time it is turned on, the ship travels ¼ of the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: distance to its destination. Write a program that uses a do loop to find out how many burns are required to get from Earth to within 1 meter of Mars and what that final distance is. - Use 58,000,000 km as the distance from Earth to Mars. - Use double precision variables except for the loop counter. - Your program should compile in Force 2.0 with no errors or warnings. - The correct answer is 87 burns and 0.782993053 m. This should be written to the screen exactly as: The number of burns is 87. The final distance between the ship and Mars is 0.782993053 m. Save this file as YourLastNameHW2.f and email it to me at douceea@tigermail.auburn.edu . Pay attention to units. Yes, you must put the period after the 87 and the m when writing the output to the screen. Answer the syntax questions above in the same file as comments before your code begins. No late work will be accepted....
View Full Document

This note was uploaded on 11/21/2011 for the course AERO 3970 taught by Professor Doucette during the Spring '11 term at Auburn University.

Ask a homework question - tutors are online