// This is mainlinear.cc


#include<iostream.h>
#include"curvefit.h"
#include<fstream.h> 


int main() 
	{
	
	unsigned int n;
	cout << "Indicate total no of (x,y)-pairs: " << endl;
	cin >> n;
	
	LinearData line(n);
	cout << "Type in data, in (x,y)-pairs: " << endl;
	line.ReadData( cin );
		
	
	StraightLineFit straight(line);
	cout << "Fitted line is: slope = " << straight.Slope() <<  
		" +/- " << straight.DeltaSlope() << endl;
	cout << "intersection = " << straight.Intersect() <<
		" +/- " << straight.DeltaIntc() << endl;
		
	cout << endl;
	line.SaveData(straight);
	
	return 0;
	}
