How to stop taking in input once "done" is typed

I was trying to write a code to find the average of the numbers entered by a user. I stored them in an array. The problem here is that I need to stop taking in numbers once the user types in the word "done." This creates a problem because I initialized the array with integers and so I don't know how to tell it to accept strings. If I initialize the array with strings then I can't add the numbers up. Can anyone help me? I was thinking I needed to take the numbers in as strings and then convert them to integers if they aren't equal to "done" but I'm not sure how to proceed with this. Can anyone help me?
Topic archived. No new replies allowed.