Error saying expected primary expression before 'float'

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];


}
}
double Linear_slope()
{
int N=NumOfPoints;
double x_y_sum=sum(float x[],float y[]);
double x_sum=GetSum(float x[]);
double y_sum=GetSum(float y[]);
double xx=sum_squares(float x[]);
b=(N*(x_y_sum)-(x_sum)*(y_sum))/(N*(xx)-(x_sum*x_sum));
return b;
}
double Linear_Intercept()
{
int N=NumOfPoints;
double y_sum=GetSum(float y[]);
double x_sum=GetSum(float x[]);
int b=Linear_slope();
a=(y_sum-b*(x_sum))/(N);
return a;
}

Thanks !
this
1
2
3
4
double x_y_sum=sum(float x[],float y[]);
double x_sum=GetSum(float x[]);
double y_sum=GetSum(float y[]);
double xx=sum_squares(float x[]);
should be
1
2
3
4
double x_y_sum=sum(x,y);
double x_sum=GetSum(x);
double y_sum=GetSum(y);
double xx=sum_squares(x);


use [code]your code here[/code]
Topic archived. No new replies allowed.