Fortran Problem List - 50 Batch-1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Assignment (Problem List)

Programming in FORTRAN

1. Write a Fortran program to calculate the area of a triangle, circle, and rectangle.
2. Write a Fortran program to convert the given temperature in Fahrenheit to Celsius and vice
versa.
3. Write a Fortran program to determine whether a given year is leap year or not.
4. Write a Fortran program to calculate factorial of a given number.
5. Write a Fortran program to determine the following:
(a) 1+2+3+ … … +n; (d) 1+3+5+ … … +2n-1;
(b) 12 + 22 + 32 + … … + n2 ; (e) 2+4+6+ … … +2n;
(c) 13 + 23 + 33 + … … + n3 ;
6. Write a Fortran program to identify the nature of the conic:
ax2  2hxy  by2  2 gx  2 fy  c  0 .

Also print the value of ab  h 2 and   a b c  2 f g h  a f 2  b g 2  c h 2 .


7. Write a Fortran program to read the values g , f and c of the circle

x2  y 2  2 gx  2 fy  c  0 and then calculate the radius and centre of the circle.


8. Write a Fortran program to display Fibonacci series: 1 1 2 3 5 8 13 21 34 … .
9. Write a Fortran program to display all prime numbers between any two integers.
10. Write a Fortran program to calculate the sum and mean of a list of integers.
11. Write a Fortran program to read the total monthly consumption and compute the monthly
electric bill of a household. Given the rate of electricity is Tk. 2.50 per unit for first 100
units, Tk. 4.00 per unit for the next 100 units and Tk. 7.00 per unit for above 200 units.
There is also a line rent of Tk. 120 per month and 15% tax on the total number of units
consumed.
12. The commission on a salesman’s total sales is as follows:
(i) If sales  Tk. 100, then there is no commission.
(ii) If 100  sales  Tk. 500, then commission=10% of sales.
(iii) If sales  Tk. 500, then commission=Tk. 50+15% of sales above Tk. 500.
Write a Fortran program to read the salesman’s total sales and calculate the commission.
13. The cost of selling a package by an express delivery service is $15.00 for the first two
pounds, and $5.00 for each pound of fraction there of over two pounds. If the package
weight is more than 70 pounds a $15.00 excess weight surcharge is added to the cost. No
package over 100 pounds will be accepted. Write a Fortran program that accepts the weight
of a package in pounds and computes the cost of mailing the package. Be sure to handle the
case of overweight packages
14. Write a Fortran program to generate a table of square of roots, squares, and cubes of n
numbers. Use the FORMAT statement. The table must look like:
Number Square Root Square Cube
--------- --------------- --------- ---------
--------- --------------- --------- ---------

Page 1 of 2
15. Write a Fortran program to read and obtained mark of a course between 1 and 100 and
calculate the grade and grade point as follows:
Mark ≥ 80 ‘A+’; Mark ≥ 75 ‘A’; Mark ≥ 70 ‘A-’; Mark ≥ 65 ‘B+’; Mark ≥ 60 ‘B’; Mark ≥
55 ‘B-’; Mark ≥ 50 ‘C+’; Mark ≥ 45 ‘C’; Mark ≥ 40 ‘D’; Mark ≤40 ‘F’.
16. Write a Fortran program to calculate the GPA for a first year student of Mathematics
department for 10 courses. The obtained marks for a course between are 0 and 100, and the
grade and grade points are as follows:
Mark ≥ 80 ‘A+’ ‘4.00’; Mark ≥ 75 ‘A’ ‘3.75’; Mark ≥ 70 ‘A-’ ‘3.50’; Mark ≥ 65 ‘B+’
‘3.25’; Mark ≥ 60 ‘B’ ‘3.00’; Mark ≥ 55 ‘B-’ ‘2.75’; Mark ≥ 50 ‘C+’ ‘2.5’; Mark ≥ 45 ‘C’
‘2.25’; Mark ≥ 40 ‘D’ ‘2.00’; Mark ≤40 ‘F’ ‘0.00’.
Display the result in the following form:
Roll Name Course Code Credit Obtained Marks Grade Grade Point GPA
----------- ---------------- ---------------- ----------- -------------------- -------- -------------- --------
2022001 Mr. X Math101 4 76 A 3.75 3.90
Math102 4 85 A+ 4.00
-- -- -- -- --
-- -- -- -- --
-- -- -- -- --
17. Write a Fortran program to solve quadratic equation ax 2  bx  c  0, a  0 using else if

statements. In result sheet first print the value of discriminant, the nature of the roots and
value of the roots. Results must be print in following form.
Rootr1 =********
Rootr2 =********
18. Write a Fortran program to sort a list of numbers in ascending and descending order and hence
print them. Also print the maximum and minimum number.
19. Write a Fortran program to display the largest five numbers from a list of numbers.
20. Write a Fortran program to display the smallest four numbers from a list of numbers.
21. Write a Fortran program that will read and display a matrix and its transpose.
22. Write a Fortran program to read and display a matrix and also calculate its determinant.
23. Write a Fortran program to multiply two matrices and display the result.
24. Write a program to read in the vertices of a triangle and decide whether the triangle is a right triangle,
isosceles triangle or an equilateral triangle.

Page 2 of 2

You might also like