Create a class named ’Rectangle’ with two data members- length and breadth and a method to calculate the area which is ’length*breadth’. The class has three constructors which are: 1 – Having no parameter – values of both length and breadth are assigned zero. 2 – Having two numbers as parameters – the two numbers are assigned as length and breadth respectively. 3 – Having one number as parameter – both length and breadth are assigned that number. Now, create objects of the ’Rectangle’ class having none, one and two parameters and print their areas.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.