



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Exam Code(s) (^) 1BM121, 1BG121, 1EG Exam(s) (^) First Year Engineering
(Mechanical, Biomedical, Undenominated)
Module Code(s) (^) ME Module(s) (^) Engineering Computing I (Fortran)
Paper No. (^1) Repeat Paper -
External Examiner(s) (^) Professor J. Fitzpatrick Internal Examiner(s) (^) Professor P.E. McHugh
Instructions: (^) • Answer 3 questions.
Duration 2 hours No. of Pages (^) 6 Department(s) (^) Mechanical and Biomedical Engineering Course Co-ordinator(s)
Requirements : MCQ - Handout - Statistical/ Log Tables - Cambridge Tables - Graph Paper - Log Graph Paper - Other Materials -
1 .(a) Briefly explain LOGICAL variables, logical operators and logical expressions. Use Fortran 95 statements to illustrate your answers. (5 points)
(b) Draw a flowchart and write a programme in Fortran 95 to sort a list of student names in descending order based on overall marks. The input data consist of a list of 150 names and their corresponding laboratory and examination marks. The output should be the ordered list of names and the corresponding overall mark. Use files for input and results.
Hint : Employ the bubblesort algorithm. (15 points)
2. (a) Describe the possible uses of the MODULE facility in Fortran 95. Use sketches and code samples, as appropriate, to illustrate your answers. (6 points)
(b) Draw a flowchart and write a Fortran 95 programme to compute the integral
b
a
x f
f
− 2
3 1 3
using the trapezoidal rule ( i.e. approximating the function by linearly varying small steps). Read in the parameters f 1 , f 2 , f 3 , a , b and n , the number of subdivisions of the range a to b and output the value of the integral. Your programme should compare the approximate result with the exact analytic result given in the formula below. Output the exact result and the normalized error.
− − a f b f f
f
3 2
3
(^1 212) (14 points)
3. (a) Briefly explain what a recurrence relation is and the advantages of exploiting recurrence in numerical computation. Illustrate using the power series expansion for the exponential function
∞
=
i x
(b) The sine of an angle x , in radians , is the result of the summation of the infinite series:
3 5 7 9
Draw a flowchart and write a Fortran 95 programme to read in a number of angles in units of degrees , and for each of them to sum the first 50 terms of the series. At the end, compare your summations with the intrinsic procedure value SIN(X). (15 points)