Please help: C++ program
I am having trouble with the random number generator. For week 0 only, I want to set the starting number of roaches in House A (totalRoachesInHouseA) to 97 and the number of roaches in House B (totalRoachesInHouseB) to 79. Then, for weeks 1 to 10, I want to generate random numbers for both houses. I am trying to get the same numbers in the example simulation below.

    Initial Population: Week 0: House 1 = 97; House 2 = 79
    Week 1: House 1 = 119; House 2 = 109
    Week 2: House 1 = 151; House 2 = 144
    Week 3: House 1 = 194; House 2 = 189
    Week 4: House 1 = 25; House 2 = 247
    Week 5: House 1 = 118; House 2 = 235
    Week 6: House 1 = 198; House 2 = 260
    Week 7: House 1 = 280; House 2 = 314
    Week 8: House 1 = 37; House 2 = 395
    Week 9: House 1 = 187; House 2 = 374
    Week 10: House 1 = 315; House 2 = 414
    
    
    Here's what I have so far. 
        #include <iostream>
        #include <cmath>
        #include <cstdlib>
        using namespace std;


        int roachesInHouseA, roachesInHouseB; //my two houses.
        int temporaryHouseA, temporaryHouseB;
        double totalRoachesInHouseA, totalRoachesInHouseB; //the total count of houses. 
        int week;


        int main( )
        {

        int temporaryHouseA = 0; // storage for arithmetic
        int temporaryHouseB = 0; // storage for arithmetic

        int totalRoachesInHouseA = 97; // test number for A
        int totalRoachesInHouseB = 79; // test number for B

        roachesInHouseA = rand() % 100 + 10;
        roachesInHouseB = rand() % 100 + 10;

        //The functions declaring the random count of roaches in both houses between 
        //10 and 100.
        

        for (int Z = 1; Z < 12; Z++) // My for loop iterating up to 11 weeks.
        {
        totalRoachesInHouseA = totalRoachesInHouseA + roachesInHouseA * .3; 
        totalRoachesInHouseB = totalRoachesInHouseB + roachesInHouseB * .3; 

        // My function declaring that the roach population explodes by 30% weekly.

        cout << "The number of roaches in House A is " << totalRoachesInHouseA <<   
                endl;
        cout << "The number of roaches in House B is " << totalRoachesInHouseB << 
                endl;


        if ((week == 4) || (week == 8)) // It's extermination time!
        {
        totalRoachesInHouseA = totalRoachesInHouseA - roachesInHouseA * .9;
        totalRoachesInHouseB = totalRoachesInHouseB - roachesInHouseB * .9;
        }

        else if (totalRoachesInHouseA > totalRoachesInHouseB) // Migration from  
        //House A to HouseB 
        {
        temporaryHouseA = totalRoachesInHouseA * .3;
        totalRoachesInHouseA = totalRoachesInHouseA - temporaryHouseA;
        totalRoachesInHouseB = totalRoachesInHouseB + temporaryHouseA;
        }

        else if (totalRoachesInHouseA < totalRoachesInHouseB) // Migration from  
        // House B to House A
        {
        temporaryHouseB = totalRoachesInHouseB * .3;
        totalRoachesInHouseB = totalRoachesInHouseB - temporaryHouseB;
        totalRoachesInHouseA = totalRoachesInHouseA + temporaryHouseB;
        }

        }

        }

Please help: C++ program
===

I am having trouble with the random number generator. For week 0 only, I want to set the starting number of roaches in House A (totalRoachesInHouseA) to 97 and the number of roaches in House B (totalRoachesInHouseB) to 79. Then, for weeks 1 to 10, I want to generate random numbers for both houses. I am trying to get the same numbers in the example simulation below.

    Initial Population: Week 0: House 1 = 97; House 2 = 79
    Week 1: House 1 = 119; House 2 = 109
    Week 2: House 1 = 151; House 2 = 144
    Week 3: House 1 = 194; House 2 = 189
    Week 4: House 1 = 25; House 2 = 247
    Week 5: House 1 = 118; House 2 = 235
    Week 6: House 1 = 198; House 2 = 260
    Week 7: House 1 = 280; House 2 = 314
    Week 8: House 1 = 37; House 2 = 395
    Week 9: House 1 = 187; House 2 = 374
    Week 10: House 1 = 315; House 2 = 414
    
    
    Here's what I have so far. 
        #include <iostream>
        #include <cmath>
        #include <cstdlib>
        using namespace std;


        int roachesInHouseA, roachesInHouseB; //my two houses.
        int temporaryHouseA, temporaryHouseB;
        double totalRoachesInHouseA, totalRoachesInHouseB; //the total count of houses. 
        int week;


        int main( )
        {

        int temporaryHouseA = 0; // storage for arithmetic
        int temporaryHouseB = 0; // storage for arithmetic

        int totalRoachesInHouseA = 97; // test number for A
        int totalRoachesInHouseB = 79; // test number for B

        roachesInHouseA = rand() % 100 + 10;
        roachesInHouseB = rand() % 100 + 10;

        //The functions declaring the random count of roaches in both houses between 
        //10 and 100.
        

        for (int Z = 1; Z < 12; Z++) // My for loop iterating up to 11 weeks.
        {
        totalRoachesInHouseA = totalRoachesInHouseA + roachesInHouseA * .3; 
        totalRoachesInHouseB = totalRoachesInHouseB + roachesInHouseB * .3; 

        // My function declaring that the roach population explodes by 30% weekly.

        cout << "The number of roaches in House A is " << totalRoachesInHouseA <<   
                endl;
        cout << "The number of roaches in House B is " << totalRoachesInHouseB << 
                endl;


        if ((week == 4) || (week == 8)) // It's extermination time!
        {
        totalRoachesInHouseA = totalRoachesInHouseA - roachesInHouseA * .9;
        totalRoachesInHouseB = totalRoachesInHouseB - roachesInHouseB * .9;
        }

        else if (totalRoachesInHouseA > totalRoachesInHouseB) // Migration from  
        //House A to HouseB 
        {
        temporaryHouseA = totalRoachesInHouseA * .3;
        totalRoachesInHouseA = totalRoachesInHouseA - temporaryHouseA;
        totalRoachesInHouseB = totalRoachesInHouseB + temporaryHouseA;
        }

        else if (totalRoachesInHouseA < totalRoachesInHouseB) // Migration from  
        // House B to House A
        {
        temporaryHouseB = totalRoachesInHouseB * .3;
        totalRoachesInHouseB = totalRoachesInHouseB - temporaryHouseB;
        totalRoachesInHouseA = totalRoachesInHouseA + temporaryHouseB;
        }

        }

        }
