Need some help

So I am supposed to write a code that does the following below. I am in a beginners C++ course and am looking for help in terms of starting. I do not want anyone to write the code down, but a few step by step instructions would be great on where to go with it!!

Many properties in engineering and science can be analyzed by trying to fit a straight line which uses x as the independent variable and y as the dependent variable. You have an array of x values and a corresponding array of y values. Create the process to fit a straight line to the data. Using the y = mx + b, where m is the slope and b is the y intercept, m can be calculated by the formula
(Σx * Σy - n Σ(x * y))/((Σx)2 – n Σ(x)2 )

where n is the number points and b is given by
(Σy – slope * Σx)/n
where n is again the number of points.
closed account (E0p9LyTq)
How would you solve the problem with your head, paper and a pencil?

Write down each step and then go back and try to write code for each step.
I've tried except I don't even know how I would go about starting this
If you don't know know how to solve the problem on paper, then your never going to get it in a program. Learn how to do it on paper first.
Topic archived. No new replies allowed.