/* testfunc06.cpp CIS 150 6/9/2005 David Klick This program demonstrates how to create a die rolling simulator that rolls two dice at a time (useful for games like craps). */ #include #include #include #include using std::cout; using std::cin; int roll(); // function prototype int roll2(); // function prototype int main(void) { int numrolls; // how many times to roll the die int i; // loop counter // initialize random number generator srand(time(NULL)); // find out how many rolls the user wants cout << "How many rolls? (0 - 100) "; cin >> numrolls; // end program if user entered something invalid if (numrolls<0 || numrolls>100) { cout << "Error: Invalid number of rolls\n"; return(1); } // generate and display rolls of dice for (i=0; i