program Oiltank

!-----------------------------------------------------
!Compiled by Ted Hertel
!ENGR 225 Fall 2010
!
!This program will calculate the cost of an oil tank in problem 2.17, given the radius
!       Inputs: radius (square meters)
!       Outputs: cost ($)
!-----------------------------------------------------

implicit none
real::cost,r,pi
pi = 3.1415

!get input
write (*,*) "Enter radius of oil tank"
read (*,*) r

!calculate cost

cost = (400 * (pi * (r**2) * sqrt (2.0) ) ) + (300 * (2 * pi * r * ((500 - ((pi * (r**3))/3))/(pi * (r**2)))))

!write outputs
write (*,*) "Cost of tank with radius r=" , r, " is "
write (*,*) "$" , cost

stop
end program Oiltank
