#include <iostream>
#include <time.h>
#include <iomanip>

using namespace std;
 
int main(){
    cout << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
    srand(time(NULL));
    
    //6 faces,  random,  multiple rolls.
    
    //  Number of rolls.   Faces of the dice.
    
    int numRolls;
    
    cout <<"How many times would you like to roll the dice? ";
    cin >> numRolls;
    
    double diceOutcome[6]={0}; // 0-5,  all set to 0.
    
    for(int i=0; i<numRolls; i++){
        diceOutcome[rand()%6]++;//Rand is 0 indexed as well, thus %6 = a random number 0-5
    }
    
    for(int i=0; i<6; i++){
        cout <<"\n\nThe number of times that "<< i+1 << " was rolled is: "<< diceOutcome[i]<<endl;
        cout <<"The percentage of the total that "<<i+1 << " came up was: " << (100*(diceOutcome[i] / numRolls)) << "%";
    }
    
    cout <<endl;
    
    
 return 0;
}
