Question: Do not use pointers or vectors Goals: Developing problem-solving skills, declaring variables, reading data from a file, using loops, and using arrays and functions Problem:

 Do not use pointers or vectors Goals: Developing problem-solving skills, declaringvariables, reading data from a file, using loops, and using arrays and

Do not use pointers or vectors

Goals: Developing problem-solving skills, declaring variables, reading data from a file, using loops, and using arrays and functions Problem: Many engineering and scientific relationships can be manipulated to a format of a straight line, y-mx +b, where m is the slope of the line and b is the y intercept. However, because most measurements have some inherent error, the formula for the line may not be obvious. Therefore, linear regression may be used to determine the best fit of a line to the measured data. Linear regression uses the following two equations for calculations of slope and y-intercept. Slope- (2x), n ?(x)2 ?y-slope * ?? y-intercept- where n is the number of (x,y) data sets that were measured. The "goodness of fit" of this straight line can be estimated by summing the square of the residuals. The residual is defined as the difference between the measured y value and the calculated y value (using the calculated slope and y-intercept) for a given x. The equation is shown below where ym is the measured "goodness of fit"- (ym-y)2 y value and ?? is the calculated y value. A lower "goodness of fit" value indicates a better match of the line to the data For this assignment you write the C++ source code that uses a set of data to determine the slope and y-intercept of the line the best fits this data. The data is stored in a file called

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!