fork download
  1. program population
  2.  
  3. !----------------------------------------------------------------
  4. !Created by Ted Hertel
  5. !ENGR 225 5-8pm Lab
  6. !
  7. !This program will calculate the population growth(P)
  8. !Given the following inputs:
  9. ! Initial population : InlPop
  10. ! Growth Rate:(b-d)
  11. ! b : birthrate
  12. ! d : deathrate
  13. ! Time period: t
  14. !Output: population growth: p
  15. !
  16. !----------------------------------------------------------------
  17.  
  18. implicit none
  19. real::p,inlpop,b,d,t
  20.  
  21. !Get inputs
  22. write (*,*) "Enter Initial Population, Birthrate, Deathrate, and Time period"
  23. read (*,*) inlpop, b, d, t
  24.  
  25. !Compute population growth
  26. p = inlpop * exp((b - d) * t)
  27.  
  28. !Display outputs
  29. Write (*,*) "The population growth is "
  30. write (*,*) p
  31.  
  32.  
  33.  
  34. end program population
  35.  
  36.  
Success #stdin #stdout 0s 2620KB
stdin
50,13,12,1
stdout
 Enter Initial Population, Birthrate, Deathrate, and Time period
 The population growth is 
   135.91409