Professional Documents
Culture Documents
Session -1
Question 1: (Expressions)
Rewrite the following expression so that it contains the equivalent symbolic relational
operators and
then ad
d
parenthesis to ind
icate the ord
er of evaluation,
.NOT.A.AND.B.EQV.C.OR.D.AND.E.OR.x.GT.y.AND.y.eq.z
Write a simple program to read
in the rad
ius and
calculate the area of the correspond
ing
circle and
volume of the sphere.
(Use the statements: DO, PRINT and
READ. And
, the value of PI is 3.14159
)
Write a program to accept three (INTEGER) lengths and
report back on whether these
lengths could
d
e ne an equilateral, isosoles or scalene triangle (3, 2 or 0 equal length sid
es)
or whether they cannot form a triangle.
Write a program to read
in a vector d
e ned
by a length, r and
an angle, , in d
egrees which
prints out the correspond
ing (x; y) co-ord
inates. Recall that arguments to trigonometric
functions are in rad
ians.
Using a SELECT CASE block and
integer d
ivision write a program that read
s in a d
ecimal
number between 0 and
9
9
9
and
prints out the equivalent in Roman Numerals.
Give the rank, bound
s, size and
shape of the arrays d
e ned
as follows:
REAL, DIMENSION(1:10) :: ONE
REAL, DIMENSION(2,0:2) :: TWO
INTEGER, DIMENSION(-1:1,3,2) :: THREE
REAL, DIMENSION(0:1,3) :: FOUR
Given
REAL, DIMENSION(1:10) :: ONE
REAL, DIMENSION(2,0:2) :: TWO
INTEGER, DIMENSION(-1:1,3,2) :: THREE
REAL, DIMENSION(0:1,3) :: FOUR
Declare an array of rank 3 which might be suitable for representing a hotel with 8 floors and
16 rooms on each floor and
two bed
s in each room. How would
the second
bed
in the 5th
room on floor 7 be referenced
?
Given
REAL, DIMENSION(1:10) :: ONE
REAL, DIMENSION(2,0:2) :: TWO
INTEGER, DIMENSION(-1:1,3,2) :: THREE
REAL, DIMENSION(0:1,3) :: FOUR
Declare an array which would
be suitable for representing a chess board
. Write a program to
set all the white squares to zero and
the black squares to unity. (A chess board
is 8x8 with
alternate black and
white squares)
Write a main program and
internal subroutine that returns, as its rst argument, the sum of
two real numbers.
Write a main program and
an internal function that returns the sum of two real numbers
supplied
as arguments.
Write a program which contains an internal function that returns the stand
ard
d
eviation from
the mean of an array of real values. Note that if the mean of a sequence of values (xi ; i = 1;
n) is d
enoted
by “m” and
the stand
ard
d
eviation is d
enoted
by “s”.
Write a mod
ule containing a function which returns the position of a particular number in an
array of sorted
integers.
Write a MODULE called
Integer Complex Arithmetic which contains 4 FUNCTIONs each
accepting two integer complex number `operand
s' and
d
elivering the result of ad
d
ition,
subtraction, multiplication and
d
ivision. (Hint: Use d
erived
d
ata types)