Hi There
Im having difficulty with sorting out an element in my code.
I have an array with 6 spots that need to increment every time the user enters one of the figures.
That part i have done
I need to show what the highest and lowest scores were
Ive done that too
But now I need to attach a string to the highest and lowest. The problem is that if there are multiple spots e.g 2,2,2 for the lowest. the computer says lowest = 2 which is good but when I attach a string to match the correct array element three strings will print out. I only need it to say one, more importantly the lowest array element.
array
Assume the user knows what colour represent which number
yellow = 1, green = 2, purple = 3, white = 4, black = 5, blue = 6, red = 7
int colours[]={1,2,3,4,5,6,};
int counter[]={0,0,0,0,0,0};
e.g user enters numbers
2
2
3
3
4
4
4
5
5
5
6
6
6
7
7
7
7
I want the print out to look like this:
the lowest number was "green" with 2
the highest number was "red" with 7
Except its doing this:
The lowest number was "green" with 2
the lowest number was "purple" with 2
and so on
Any help would be awesome
Thanks