This document provides instructions for developing a program to test a Rectangle class. The program requires a Rectangle.h file to define the Rectangle class with length and width variables and methods to access them, calculate area and perimeter, display rectangle information, and overload the = operator. It also requires Rectangle.cpp to define the public class methods and RectangleTest.cpp to prompt the user for rectangle dimensions, create Rectangle objects, call display and = methods, and output sample runs.
In this lab you will develop a program to test a Rectangle c.pdf
1. In this lab you will develop a program to test a Rectangle class.: Following files will be needed. 1.
Rectangle.h This will define a Rectangle class. The class definition includes a. Two private float
variables for storing length and width b. A constructor that takes two parameters one for initializing
the length and other for initializing the width c. Mutator and Accessor method for length and width
variables d. And following four methods e. float getArea(); f. float getPerimeter(); g. void display (;
h. void operator=-(Rectangle rect 2 ); This is an operator overloading function You can use inline
definitions for functions needed for parts b and c but functions in parts e to h must be declared as
public functions. 2. Rectangle.cpp This file must contain the body of public class functions and
must include Rectangle.h 3. RectangleTest.cpp 1. Ask the user lengths and widths of two
rectangles. 2. Using that information to create two Rectangle objects 3. Call display function of
both rectangles 4. Call the = overloaded function. Some simple runs of the program are as follows:
Please enter length of flist Rectangle : 4 Please enter width of flrst Rectangle : 5 Please enter
length of second Rectangle : 2 Please enter width of second Rectangle : 10 Rectangle 1 's
tnformation Length =4 width=5 Area=20 Perineter=18 Rectangle 1 's information Length =2
width=10 Area=20 Perlneter=24