I need help on Class construction assignment

I am bit confuse about this assignment my professor gave me. I had coded "most" of the main parts for this construction but in the <int main()>. I stuck on the part where it ask for the length of each side from vertex. I do not know what to put for the {cout<<"side length"}. Could any kind heart help me on this small part?

Much appreciate in advance.
Here's the construction I got so far:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
using namespace std;
class POINT
{
private: float x, y;
public: void Read()	{cin>>x>>y;}
		void Show()	{cout<<"("<<x<<","<<y<<")";}
		//find and return the distance from p to q
		friend float Distance(POINT p, POINT q)
		{
			return sqrt( (p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
		}
};
int main()
{
	POINT A,B,C,D;
  cout<<"To draw a rectangle, please\n"<<"\tEnter the coefficient of vertex A: ";
  A.Read();
  cout<<"\tEnter the coefficient of vertex B: ";
  B.Read();
  cout<<"\tEnter the coefficient of vertex C: ";
  C.Read();
  cout<<"\tEnter the coefficient of vertex D: ";
  D.Read();
  A.Show(); cout<<"--------";
  B.Show();
   cout<<"\n    |"<<"\t"<<"     |"<<"\n"
	     <<"    |"<<"\t"<<"     |"<<"\n";
  C.Show();        cout<<"--------";
  D.Show();        cout << "\n";

  Distance (A,B);
  cout<<"Length of the side AB= " //<<-----What can I put here?
	  ; cout<<"\n";      //<
  Distance (B,D);
  cout<<"Length of the side BD= " //<<-----What can I put here?
	  ; cout<<"\n";
  

  //Terminate
  system("pause");
  return 0;
}
It looks like you should put

cout<<"Length of the side AB= " << Distance(A,B);

etc.
Topic archived. No new replies allowed.