Computer Programming
UU-COM-2013-MW
, Q1.
//stream classes (Glassborow, 2006)
#include <iostream>
using std::cout;
using std::ios;
#include <iomanip>
using std::setw;
using std::setprecision;
using std::fixed;
using std::showpoint;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
const long ROLLS = 40000;
const int SIZE = 13;
// array expected contains counts for the expected (Forouzan, 2020)
// number of times each sum occurs in 36 rolls of the dice
int expected[ SIZE ] = { 0,0,1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 };
int x; // first die