I can see only one problem:
the code is written by a non-programmer.
No, no, please don't get offended: I'm not going to discourage you and suggest to quite. Just the opposite: I want to encourage you
to become a programmer. This is first thing you need, but it will require you to change your thinking dramatically.
Sorry, but I cannot help you to solve the problem you want to solve and meet deadline. Remember that a deadline is your problem, not ours.
And you did not formulate your problem; and this is another sign of a non-programmer. You need to change yourself first until it's too late.
Let's see:
switch(roll[5])
{
case 1: ++count[0]; break;
case 2: ++count[1]; break;
case 3: ++count[2]; break;
case 4: ++count[3]; break;
case 5: ++count[4]; break;
case 6: ++count[5]; break;
}
A programmer will never write anything like that, not even
roll[5]
, because
immediate constant 5 is not supportable. It will be something like
++count[roll[maxRollNumber] - 1];
Same thing about
score[0] = count[0]*1;
score[1] = count[1]*2;
Must be something like
for (int index = 0; index < maxRollNumber; ++index)
score[index] *= 2;
And so on… What you have written is something opposite to the very idea of programming. And don't even play with the idea that you need to pass the test first and get a working program, fix things letter. In certain principle things, there is no later fix. Never.
And, please, one warning before you decide to reply: please, don't repeat a common mistake, don't say "I'm a beginner". Just don't. We know, so what? This is completely irrelevant.
Unlearn what you have learned.
—SA