// Arup Guha
// 9/15/09
// Honors Mathematical Modeling
// Simulation of car rental problem from 1.4 of the textbook.

#include <stdio.h>

#define TAMPA_INIT 6000
#define ORLANDO_INIT 1000
#define NUMSTEPS 100

int main() {
    
    int cars_tampa = TAMPA_INIT;
    int cars_orlando = ORLANDO_INIT;
    int i;
    
    // Step through each day.
    for (i=0; i<NUMSTEPS; i++) {
        
        // Print out this day.
        printf("Day %d: Tampa %d\tOrlando %d\n", i, cars_tampa, cars_orlando);
        
        // Calculate for the next day.
        int new_orlando = (int)(.6*cars_orlando + .3*cars_tampa);
        int new_tampa = TAMPA_INIT + ORLANDO_INIT - new_orlando;
        
        // Reset our variables for the next day.
        cars_tampa = new_tampa;
        cars_orlando = new_orlando;
        
    }    

    system("PAUSE");
    return 0;
}
