heres the deal. i was in the hospital for 5 days and during those five days i missed the whole section about arays in class and i just cant figure out how they work. And the only time there is help avalible at school is when im working.
i need to be able to declare, use, and manipulate arrays. like with a gymnastics or diving competition, each contestant's score is calculated by dropping the lowest and highest scores and then adding the remaining scores. A judge awards points between 1 and 10, with 1 being the lowest and 10 being the highest. i need to write a program that will read judges' scores from an input file (there will be between 5 and 10 scores) and output the points received by the contestant, formatted with two decimal places.
and i cant figure out how i would drop the scores or how an array would even be able to do any of this.
please help. if you live in the buffalo area or wish to call (716) 504-7561
how does it work like if i gave you three #'s and needed to do something with it like add them, how would i put them in an array? replace them with diff variables\
iv just never seen one is it possible for you to write a small example so i can match it with the links you sent me to get the just of it.
what do you mean? if you dont take them from the array, is there something to do to determin the high and low?
One way would be to sort the array and only use elements [1..n-2], but that's probably too complicated in this case.
Another is to determine the positions of the max and min and not use them in the calculation. That should be simple enough.
Okay, here's an example:
1 2 3 4 5 6 7
//sum all the elements in the array:
constint n=/*size of the array. must be known at compile time*/;
int array[n];
//TODO: fill the array
int sum=0;
for (int i=0;i<n;i++)
sum+=array[i];