// Arup Guha
// 9/15/09
// Honors Mathematical Modeling
// Simulation of owl/hawk problem from 1.4 of the textbook.

#include <stdio.h>

#define OWLS_INIT 10
#define HAWKS_INIT 10
#define NUMSTEPS 100

int main() {
    
    double owls = OWLS_INIT;
    double hawks = HAWKS_INIT;
    int i;
    
    // Step through each day.
    for (i=0; i<NUMSTEPS; i++) {
        
        // Print out this day.
        printf("Day %d: Owls %.0lf\tHawks %.0lf\n", i, owls, hawks);
        
        // Calculate for the next day.
        double new_owls = (1.2*owls - 0.001*owls*hawks);
        double new_hawks = (1.3*hawks - 0.002*owls*hawks);
        
        // Reset our variables for the next day.
        owls = new_owls;
        hawks = new_hawks;
        
        // Simulation doesn't make sense if one species is gone.
        if (owls <= 0 || hawks <= 0)
            break;
        
    }    

    system("PAUSE");
    return 0;
}
