I am trying to figur out how to write a program that simulates the rolling of two dice. Using rand() function roll the two dice one after the other. Use srand (time(0)); for setting the initial seed value. The sum of the two dice values in any through will be between 2 and 12. The probabilities for the various sums are: for 2 and for 12: 2.778%; for 3 and for 11: 5.556%; for 4 and for 10: 8.333%; for 5 and for 9: 11.111%; for 6 and for 8: 13.889; and for 7: 16.667%. Roll the two dice in your program 10,000 times, add the dice values in each throw and increment the appropriate sum value for the result. When all the 10,000 throws are completed, compute the probability for each of the sums (2 to 12). The program should output the results under three columns: the first one shows the sum, the second shows the theoretical probability and the third shows the observed provability.
cout << line << endl ;
myfile << i << ". " <<line << endl;
i++ ;
}
cout << "\nEnd of file.\n";
}
myfile << "Writing this to a file.\n";
myfile << "This is the second line.\n" ;
myfile.close();
incomingfile.close();
/*int num = 0 ;
A first ;
B second ;
C third ;
cout << "number? " ;
cin >> num ;
cout << num << endl ;
first.setx(num);
first.powerup();
cout << first.getx() << endl ;
second.setx( first.getx() );
cout << "second number is: " << second.getx() << endl ;