C++ is usually the best choice for game programming. But you should probably start by learning the fundamentals of Pascal. And I have to point out that HTML is not a programming language and would be completely useless to you.
The best way to do this is probably just have two variables: a counter and a total. Make their scope module level (declared at the top). When the user inputs a number, add it to the total and increment the counter. When a user wants to see the average, just divide total by counter.
OpenOffice is very similar to Microsoft Office. I'd suggest it if you need something for free. Also, you might still be able to get MS Office 2007 Beta for free.