You are on page 1of 2

VIETNAMESE-GERMAN UNIVSREITY

Introduction to Programming Course

Exercise 2
Please submit your answer file to the Google classroom before 8:00 AM Tuesday
(November 1).

Student Information:
Full name : .............................................................................................................
Student ID : .............................................................................................................

Question 1: Write programs to estimate the PI number using the For loop
a) Method 1

b) Method 2

Question 2: Write a program to estimate the Euler’s number using the For loop

1
Question 3: Write programs to estimate sin, cosine, and exponential functions using the
For loop

Question 4: Write a function to generate the Fibonacci sequence as follows:

The inputs of this function are the first two number of this sequence and the length of the
sequence.

You might also like