You are on page 1of 1

Homework 2

or Assignment 0

Due Date: January 29

1. RAND() is a function that generates a single random number in the range (0,1)1 ,
called as x = RAND(). So, a single point in x, y plane will take two calls of RAND.
Create suchp calls multiple times (≥ 10000) and check the ratio of total calls and
when the x2 + y 2 ≤ 1.0.2

2. Write a program for basic arithmetic(+, −, ×, ÷) with vector derived data type
with vector defined in R3 , e.g.
type :: vector
real :: x ,y , z
end type vector

Please:
• comment on the code generously.

• try to show the flowchart (hand-drawn is ok.)

1
Never use this in any real problem.
2
Discussed in class
1

You might also like