Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CSc 171 (C++) A Version of MPS ese * Name: Your name CSC 171 * Date: Today\'s da

ID: 3918687 • Letter: C

Question

CSc 171 (C++) A Version of MPS ese * Name: Your name CSC 171 * Date: Today's date MP 5 * Statement: Find the least squares line for the data in mp5.inp and *integrate it from the first x value to the last x value. * Specifications: * Input- a sequence of (x, y) values from a sequential file * Invokes- linreg to determine linear regression line and correlation coef *- integrate to determine the area under the curve Output-to a sequential file the least squares line y = m*x + b * the correlation coefficient * - the integral of m*x+b over the first x to the last #include dstream» #include #include

Explanation / Answer

Hi!

The answer to //1: Reduction variable initialization:

void setData(ifstream &fin, double &m, double &b)

{

fin >> m >> b; //initializing the variables m and b//

}

In the case of multiple questions, the Chegg expert can answer the first question completely, so I am solving the first question. However, if you need a solution to a specific question, you may please let me know in the comments. I would be happy to help you out.