Reading integers from a data file, and using the integers in formulas

hi i am relatively new to this and i have to create a least square fit program which will read x and y values from a data file (XandY.txt), there is 20 x and y values each. and i have to read them from the file, then input them into formulas that will add up the x and y values separately to give me a total for each.

after that i need to put these totals into two more formulae to get my final results.
im just having a lot of trouble getting it started so i would really appreciate some help
my file looks like this if it helps
x y
4 1
5 2
8 5
9 4
11 7
14 8
15 10
16 9
18 11
20 13
22 15
22 16
25 14
25 17
27 17
28 18
29 18
31 18
33 19
34 20
34 21
Topic archived. No new replies allowed.