fork(1) download
  1. PROGRAM PopulationMod
  2. !--------------------------------------------------------------------------------------------
  3. !Karl Harris ENGR 225 1-27-12
  4. !
  5. !This program will calculate population growth over time
  6. !
  7. !Identifiers used are:
  8. !PT : Population growth over time (in years)
  9. !time : time of growth (in years)
  10. !PO : Initial Population
  11. ! b : Birth Rate
  12. !d : Death Rate
  13. !--------------------------------------------------------------------------------------------
  14. IMPLICIT NONE
  15. INTEGER, PARAMETER :: dp=selected_real_kind (15) !15 sig figs
  16. Real(dp) :: PT, PO, b, d, t
  17.  
  18. !Get Initial population,birth rate, death rate,and time
  19. Write(*,*)"Pleas enter Initial population,birth rate, death rate,and time."
  20. Read(*,*) PO, b, d, t
  21.  
  22. !Calculate population growth over time
  23. PT=PO*exp((b-d)*t)
  24.  
  25. Write(*,*) "The population growth over",t,"years is",PT
  26. STOP
  27.  
  28. END PROGRAM PopulationMod
  29.  
Success #stdin #stdout 0.01s 2620KB
stdin
100 0.4 0.2 15
stdout
 Pleas enter Initial population,birth rate, death rate,and time.
 The population growth over   15.000000000000000      years is   2008.5536923187667