![]() |
Department of
Mathematics and Computer Science |
|
Math 60 -- Winter, 2006
|
|
15 points DUE: NOON: Wednesday, March 8, 2006 NO Extensions! |
Work from your Fortran-90/95 program and try to make a line for line correspondence whenever possible. The sample code given in the Java class notes should be your basic model. Most of the assignment and declarations statements should transfer over without difficulty. You should declare variables as double rather than REAL, however. The other major change will be in the output statements.
You do not need to write and use any functions -- the main point of this assignment is to realize that shifting from one language to another sometimes is not a major endeavor, especially when shifting to Java by someone who already knows C/C++ or another scientific programming language such as Fortran.
To induce spacing between numbers or strings printed on the same line, you can use the "tab" control symbol, \t within a quoted string to tab over a few spaces.
Since the use of disk files is much more complicated in Java than in Fortran or C++ (see Java Notes J4 for file IO information), it is best to write this program on the departmental Unix machine (i.e., on math) and "capture" the output by file redirection. In other words, after you have the program running correctly, redirect your output to an output file using the > sign on the command line after the java mp6 command.
As usual, use good programming style, and turn in both the program (source file) and the output file.
This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu Last changed: 24 February 2006.