1. ## Array question

Hello there-

I'm drawing a blank here with this problem: create an array of grades based on user input, add up the scores and return a letter grade. Anyhoo...what I can't seem to figure out is what the best way to create this array. I would like the user to be able to add each score one at a time ("87", "78", "100", "97"...) until the Enter key is pressed.

Any help is extremely appreciated!!!

2. well, here is simple algorithm
Code:
```integer scorearray;

do
{
prompt user to enter score
get val
scoresarray <- val
}while val not equal to '\n';

find the sum of all the scoresarray

ssharish2005

3. Presumably it's an assignment. Does the assignment mention a maximum number? In which case, create an array of N grades, then have it not allow the user enter more than N values.

If it truly has to be of arbitrary length, you could use a pointer and realloc, or ask the user how many grades they will enter, then malloc to that amount.

Finally, you could use a linked list or something, but that's somewhat overkill for this.

4. Thank you both.
This is what I had in the meantime - I think I'm on the right track.

Code:
```do
{
printf	("\nPlease enter assignments scores, one at a time. Press Enter key when done:");
scanf	(  "%i", aScore);
}	while ('\n'!=getchar());```

5. Code:
```int grades[100]={0}, i=0;