Quote Originally Posted by laserlight View Post
Ok, so you fixed an error, but you're still having an error now. What is your current code and the exact error message?


Don't just say "still didn't work" without providing such an update, otherwise I'll just retort "then fix it!"
No, baby please! I found the error and I fixed it and now the code is working the way it should.

Code:
#include<iostream>
#include<iomanip>
#include<array>
using namespace std;


int main(){


    const size_t responseSize{20};
    const size_t frequencySize{6};


    const array<unsigned int, responseSize> responses{1, 2, 5, 4, 3, 5, 2, 1, 3, 1, 4, 3,3, 3, 2,3, 3, 2,2, 5};


    array<unsigned int, frequencySize> frequency{};


    for (size_t answer{0}; answer < responses.size(); ++answer){
        ++frequency[responses[answer]];
    }


    cout << "Rating"  << setw(12)  << "Frequency"  << endl;


    for (size_t rating {1}; rating < frequency.size(); ++rating){
        cout << setw(6)  << rating  << setw(12)  << frequency[rating]  << endl;
    }


}