Prepare a program in c using the class as defined below -


Program: Prepare a program in C++ using the class as defined below.

Put the class definition in a separate header file, and put all the functions' code in a separate Resource file. Then write the main program in another file that will read in some numbers and test out whether your functions all work.

As you can surmise from the names, the class has two constructors test both of them, and it has two access or functions test both of them, and a function to evaluate the perimeter of the quadrilateral.

You can think of a quadrilateral as having at most only two distinct values for its sides ( a rectangle, say).

The friend function is to allow comparison of the perimeters of two quadrilaterals. Test out this function too. Keep the class definition as it is written here.

Use this as your header files

#include

using namespace std;

class Quadrilateral

{

Public:

          Quadrilatearl()

          Quadrilateral (int s1, int s2);

          void Perim();

          int GetSide1();

          int GetSide2();

          friend char Compare (Quadrilateral sh1, Quadrilateral sh2);

Private:

                 int p;

                 int side1, side2;

};

You have to use C++ language to evaluate the perimeter of the quadrilateral.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Prepare a program in c using the class as defined below -
Reference No:- TGS0957748

Expected delivery within 24 Hours