Hi , i have a piece of coursework that has to be in tomorrow -it calculates polygons using pythagoras equation the classes line.cc , point.cc and the h files are all complete and correctly coded i am just stuck on implementing the main file-any help would be great as i am really stuck?
CODE
//polygon.cc
#include "point.h"
#include "line.h"
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int x;
int y;
int sides;
cout << "Enter the number of sides between 3 and 9 Inclusive" << endl;
cin >> sides;
for ( int i=0; i<sides; i++ )
{
cout << "Enter the co-ordinates as x and y" << endl;
cin >> x >> y;
}
int length;
for ( int i =0; i < length; length++)
{
int dx = p1.getx() - p2.getx();
int dy = p1.gety() - p2.gety();
length = sqrt ( (dx*dx) + (dy*dy));
return length;
cout << " Total length = " << length << endl;
}
}
The user enters the number of sides of a polygon and it calculates the polygon boundary

*Mod Edit: added code tags: