So I'm having a problem with my code. I'm trying to make a program for linear regressions and everything else is working for now but I'm stuck on the error that says 'expected primary-expression before 'float''. Please help.
#include <iostream>
using namespace std;
const int MaxPoints=50;
float x[MaxPoints];
float y[MaxPoints];
int NumOfPoints;
int b=0.0;
int a=0.0;
float GetSum(float x[])
{
float sum_x=0.0;
for(int i=0;i<NumOfPoints;i++)
sum_x+=x[i];
return sum_x;
}
double sum(float x[],float y[])
{
float x_y=1.0;
for (int i=0;i<NumOfPoints;i++)
x_y=x[i]*y[i];
return x_y;
}
float sum_squares(float x[])
{
float square_x=1.0;
for(int i=0;i<NumOfPoints;i++)
square_x=x[i]*x[i];
return square_x;
}
void get ()
{
cout<<"How many points would you like to input ?"<<endl;
cin>>NumOfPoints;
for (int i=0;i<NumOfPoints;i++)
{
cout<<"Enter point for x"<<i+1<<endl;
cin>>x[i];
cout<<"Enter point for y"<<i+1<<endl;
cin>>y[i];