C++ fstream

Hi I was just assigned a C++ project about the fstream header,the questions is like this "
Find out about C++ file I/O using fstream header

Understand basic file I/O operation with C++.You only need to know how to :
-Open a text file
-Store numbers into a text file
-Retrieve numbers from a text file
-Close a text file

Prepare a demo C++ program to do one of the followings:
Ask user to enter 8 marks for 8 students from keyboard and store them into an array.The program will calculate the average mark and store all marks and its average into a text file.

Using notepad,prepare a text file with marks for 8 students on seperate lines.The program will then read this file and store all the marks into an array.It will then calculate the average mark.Finally,it displays all the marks and the average mark on the screen.

You must be able to explain in detail how your program works."

Yeah I know its pretty long,but I need help as I don't know anything about fstream headers,only thing I've learnt so far is the iostream header so maybe you could use that as a reference?Thanks!
I/O with fstream is exactly the same as with cin/cout
http://www.cplusplus.com/doc/tutorial/files/
Topic archived. No new replies allowed.