CPS 201
HW 2
Due: Sep. 6
1) Reading: Read Chapter 1 of the text.
2) (4 pts) Below is a list of important gures in the history of scientic computing. Look them up online
and briey describe their contributions to this eld.
Grace Hopper
Irene Stegun
James

MODULE const
INTEGER, PARAMETER : dp = KIND(1.0d0), sp = KIND(1.0e0)
REAL(KIND=dp), PARAMETER : DPI = 3.141592653589793d0
END MODULE const
PROGRAM ssn
USE const
IMPLICIT NONE
! This is a program that will ask the user to input their age
! and determine if

CPS 201
1
HW 7
Due: Oct 11
Lab Portion
This section is worth 5 points.
1) Write a program that will compute the sums below for a user-input value of n. You should write one
program that evaluates all sums rather than separate programs.
n
i3 4i2 + 1
a)
i=1

MODULE const
INTEGER, PARAMETER : dp = KIND(1.0d0), sp = KIND(1.0e0)
REAL(KIND=dp), PARAMETER : DPI = 3.141592653589793d0
END MODULE const
!
PROGRAM tpromo
USE const
IMPLICIT NONE
! Program to illustrate improper type promotion to
! double precision for f

CPS 201
Midterm Project
Due: Nov. 1
You may not discuss this assignment with anyone but me. You must email me a copy of your program and answers
to the questions posed prior to 5:00pm on the due date. I will run your program, so do not copy it into a Word

CPS 201
1
HW 8
Due: Oct 21
Lab Portion
1) (1 pt) Run the maximum height program (with no modicataions) on the course website using input
redirection to get heights from the heights_test.in le. What is the maximum height?
2
Homework Section
1) (2 pts) Modi

CPS 201
HW 6
Due: Oct 4
For this assignment, you will need to use some intrinsic fortran functions that have not been used yet (see
list on the course website for the ones that you might need).
1
Lab Portion
This section is worth 5 points
1) The program s

CPS 201
HW 4
Due: Sep. 20
This homework has 2 portions. The rst consists of some short programs that you should be able to
(mostly) complete during the lab session.
Remember to follow all the rules of programming that have been established. It helps if yo

CPS 201
HW 3
Due: Sep. 13
1) (2 pts) Write a Fortran90 program that will ask the user to input the radius of a circle and output the
area of the circle. Test your program with the value radius = 3.2.
2) (3 pts) Write a Fortran90 program that will ask the

CPS 201
HW 5
Due: Sep. 27
1) (2 pts) Explain what is wrong with the short code segment below.
INTEGER : i
i=2
DO
i = 2*i
IF(i = 3)
EXIT
ENDIF
WRITE(*,*) i = ,i
ENDDO
2) (4 pts) Trace the program below and determine its output without typing it in. How man

CPS 201
HW 1
Due: Aug. 30
1) (6 pt) Consider the list of numbers below:
1.736
29.99
0.002531
104.3
0.4929
0.01974
a) What is the exact sum of these numbers?
b) Add the numbers from largest to smallest using 4 digit chopped arithmetic. What is the relatve

Notes on HW3
Problem 1:
Ok
Problem 2:
The easiest way to enter the formula is to do
volume = DPI*radius*2*height/3
A common error is to do
volume = (1/3)*DPI*radius*2*height
This will result in 0 since the (1/3) integer
division is done first.
You can do

MODULE const
INTEGER, PARAMETER : dp = KIND(1.0d0), sp = KIND(1.0e0)
REAL(KIND=dp), PARAMETER : DPI = 3.141592653589793d0
END MODULE const
PROGRAM ssn
USE const
IMPLICIT NONE
! This is a program that will ask the user to input their age
! and determine if