fork(1) download
  1. program Oiltank
  2.  
  3. !-----------------------------------------------------
  4. !Compiled by Ted Hertel
  5. !ENGR 225 Fall 2010
  6. !
  7. !This program will calculate the cost of an oil tank in problem 2.17, given the radius
  8. ! Inputs: radius (square meters)
  9. ! Outputs: cost ($)
  10. !-----------------------------------------------------
  11.  
  12. implicit none
  13. real::cost,r,pi
  14. pi = 3.1415
  15.  
  16. !get input
  17. write (*,*) "Enter radius of oil tank"
  18. read (*,*) r
  19.  
  20. !calculate cost
  21.  
  22. cost = (400 * (pi * (r**2) * sqrt (2.0) ) ) + (300 * (2 * pi * r * ((500 - ((pi * (r**3))/3))/(pi * (r**2)))))
  23.  
  24. !write outputs
  25. write (*,*) "Cost of tank with radius r=" , r, " is "
  26. write (*,*) "$" , cost
  27.  
  28. stop
  29. end program Oiltank
  30.  
Success #stdin #stdout 0s 2620KB
stdin
5.07
stdout
 Enter radius of oil tank
 Cost of tank with radius r=   5.0700002      is 
 $   88701.406