

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this past exam paper are: Construct, Fortran, Flowchart, Nature, Roots, Distinct Real, Distinct Complex, Identical Real, Fortran Program, Flowchart
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Exam Code(s) 1BM, 1BG, 1BSE, 1EG Exam(s) 1 st^ Mechanical Engineering 1 st^ Biomedical Engineering 1 st^ Energy Systems Engineering 1 st^ Undenominated Engineering
Module Code(s) ME Module(s) Introduction to Engineering Computing
Paper No. 1 Repeat Paper
External Examiner(s) Professor Robin Clarke Internal Examiner(s) Professor Sean Leen Professor Peter McHugh
Instructions: (^) Answer 3 questions All questions carry equal marks
No. of Pages 3 (including cover) Department(s) Mechanical & Biomedical Engineering Course Co-ordinator(s) Professor Sean Leen
Requirements: MCQ n/a Handout n/a Statistical/ Log Tables n/a Cambridge Tables n/a Graph Paper n/a Log Graph Paper n/a Other Materials n/a
Release to Library: Yes
Question 1
1. (a) Describe the use of the If…else if… else…then construct in Fortran, including a flowchart illustration, with application to the specific example of identifying the nature of the roots of a quadratic equation, i.e. distinct real, distinct complex or identical real. [10]
(b) Draw a flowchart and write a Fortran program to evaluate the following function f ( x,y ) for user-specified values of x and y :
x + y if x ≥ 0 and y ≥ 0 f(x,y) = x + y 2 if x ≥ 0 and y < 0 x 2 + y if x < 0 and y ≥ 0 x^2 y^2 if^ x <^ 0 and^ y <^^0
The program should (i) read in the user specified values of x and y and (ii) output the resulting value of f ( x,y ) to a file called calc.dat. [23]
Question 2
(a) Discuss the use of iterative DO loops in Fortran 95, including a description of nested DO loops and exiting from DO loops if a particular condition is satisfied. Use examples of Fortran code to illustrate your answer. [10]
(b) (i) Draw a flowchart and write a Fortran program to calculate the trajectory of a rocket using the following formula: height 50 8 t^2 0. 5 t^4 where t is time in seconds and height is in feet. The program should stop if the time exceeds 5 seconds or when the rocket impacts with the ground. Use a time increment of 0.05 seconds for height < 50 feet, and 0.1 seconds for height ≥ 50 feet. The program should output the maximum height achieved and the associated time to the screen. The height-time response should be written out to a data file. [18]
(ii) Determine, analytically, the maximum height achieved by the rocket and the associated time and explain how this can be used to validate the program written in (i). [5]