Mail to: HCAB on MUSICB from your HC-- MUSICB code
Assignments mailed from any other E-Mail account will be
IGNORED !! (i.e. Receive a grade of ZERO!!)
Due Date: 2nd October
This assignment has to be done in FORTRAN 90, using the LAHEY
compiler, which you can download for free from
or this is available in the EMF.
See the documentation on the LAHEY website for installation
and running programs on your own machine. Note your FORTRAN
90 source code should be the ELF90 directory with the compiler
for easy operation.
NOTE: Look at the NOTES on MUSIC B for doing this and the
In this assignment you are to calculate the sum defined as follows:
x2 xn z = 1 + x + ---- + ... + ---- + ... 2! n!
The sum is considered accurate enough when term
xn ---- < 0.001 n!
that is, you should stop calculating the sum when the above condition
You should calculate the sum for the following values of x:
Print out the sum and the number of terms used to calculate the sum
for each given value of x.For example, sum
x2 x3 1 + x + ---- + ---- 2! 3!has 4 terms.
Input data should be read from data file using READ command in a loop. You
should stop upon reading value -1.0. So, your data file should look like:
To read data from data file run your program as follows:
your_compiled_program.exe < datafile
Your output should look like:z = ... number of terms = ...