[Santa Clara University]
Department of Mathematics
and Computer Science

Machine Problem 2

Math 60 -- Winter, 2006
D. C. Smolarski, S.J.

             
15 points
DUE: NOON: Monday, January 30, 2006

Write a Fortran-90/95/2003 program which gives a conversion chart between various units of length. You are to use the following: mile, kilometer, international nautical mile, (Roman) stadium, (Old Russian) verst, furlong.

The lengths should be listed in six columns. Make the first column the mile scale, the second nautical mile, then furlong, kilometer, stadium, and verst. Provide for 3 decimal place accuracy in each column.

The mile scale should start at 0 and end at 100 in increments of 10 miles. (Use these numbers in the do-loop initialization statement.)

The formulæ for conversion are as follows (you may need to do some additional algebra before writing your program!):

The output should be understandable without looking at the program code and each column of numbers should be appropriately labeled. Points will be taken off if the output is not self-explanatory, and this means giving some indication of the programmer and when it was written!

You may use single precision real variables for the computation. Use the model of MP 1 for the program structure, but try to use formatted output in order to have the numbers in the six columns right beneath each other.

Remember to use good programming style (e.g. clear code, mnemonic variable names, comments, indentation). In particular, the identifiers used for the weight values MUST be more than a single character long!!

This program should be run on the departmental HP Unix machine (i.e., on math), as was MP 0/1.

You should begin this assignment by connecting to your Ma60 directory, and then creating a new subdirectory for this program, named Mp2. (In other words, repeat the instructions appropriately given on the first two pages of MP 1.) You MUST create a new "makefile" for this assignment similar to that make for MP 1 (with the appropriate changes in the internal filenames). This same procedure should also be done for all subsequent assignments.

After you have the program running correctly and you see correct output on the screen, you should redirect your output to an output file. As with MP0, after typing the > sign on the command line after the a.out or mp2 (the executable file name -- for more information, see the Unix 6 web page), type an appropriate output filename (you might want to call it mp2ou.out).

Turn in the source file (i.e., the program code file) and the output file. This can be done by using the Unix command

     enscript -GE -b '%n' mp2.f90 mp2ou.out
(assuming these are your actual filenames).

As with MP 1, your sheets may be turned in to my office, O'Connor 32, or to my mailbox in O'Connor 31. Please staple the pages yourself and do not turn in disconnected pages!


This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
Last changed: 2 January 2006.