Given the following C++ code and input (Figure 1):
struct POINT{
int x;
int y;
};
struct SHAPE{
struct POINT pt1;
struct POINT pt2;
struct POINT pt3;
struct POINT pt4;
};
void setSHAPE(struct SHAPE &);
int calcArea(struct SHAPE);
void main()
struct SHAPE RECTANGLE;
//your code starts here
}//your code ends here

a) write function definition of setSHAPE() function to set point 1,2,3,and 4 of SHAPE
RECTANGLE
b) write function definition of calcArea() function to compute the area of SHAPE RECTANGLE
c) write a main function that call setSHAPE(), calcArea() and display the area of a shape

Nobody is going to do your homework for you. Please read our rules and then ask a specific question about the problem if you need help. And by help, I mean a little help, not giving you the answers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.