So the problem seems to be when i try to compile its telling me on line 16 of the main program (the last line) "unqualified-id at end of input" and "expected ',' or ';" at end of input
I played with just about every combination of ending brackets and semi colons i could think of but i just can't get it to compile. I'm at a loss as to what's wrong ... I use "context, and cygwin" to write the program and compile it.
oh and while your here i might as well ask you, do you know how to automatically call the class's functions from main?
Thanks for any help!!
here's my program::::
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include "plot.h"
int main()
{
plot plot1;
cout << "Available functions are:" <<endl;
cout << "Area" <<endl;
cout << "Perimeter" << endl;
cout << "Please type selection" <<endl;
return 0;
}
here's my class saved as plot.h
class plot
{
int x1, y1, x2, y2;
public:
void EnterDimensions()
{
cout <<"enter x-value of lower left point"<<endl;
cin >> x1;
cout <<"enter y-value of lower left point"<<endl;
cin >> y1;
cout <<"enter x-value of upper right point"<<endl;
cin >> x2;
cout <<"enter y-value of upper right point"<<endl;
cin >> y2;
}
int Height() { return (y2-y1); }
int Width() { return (x2-x1); }
int Area()
{
return Width()*Height();
}
int Perimeter()
{
return 2*Width()+2*Height();
};