use fscanf and fprintf

Which is what the professor is suggesting we use