Need help reading from a file(.dat) doing calculations then outputting into a new file : I need to make a program that reads the marks.dat file, outputs that file onto the screen,

marks.dat

23468555 88 55 67
55223344 45 90 78
32321111 67 89 73
77001234 79 59 99
21324354 62 84 88
40450765 34 45 56
26726826 93 69 71
30917823 57 65 80
54277888 87 77 55

The 8-digit number represents the student number and the following 3 2-digit numbers represent the assignment marks, calculate the average of the 3 that contributes 40% of the year mark, find the highest mark that contributes 60% of the year mark, then output the student number, followed by the average, followed by the year mark, i.e

yearmark.dat

23468555 70.00 80.80

The average and year mark should be of type *double* and display only 2 digits after the decimal, then output to the file and display the contents on the screen.

The problem I have is that trying to output the *double* of the 8-digit number outputs 234686e+007, however if its *int*, it then outputs correctly.

Would also like to see how you would tackle this problem, would you try create an array to insert the contents of the file, was thinking 2-d, first student number then the marks in the second dimension. Any advice or help will be appreciated