void function for the inputing data for class 'Rectangle' & uisng the overloading
| 31 | }; |
| 32 | // void function for the inputing data for class 'Rectangle' & uisng the overloading |
| 33 | void RectangleFirst() |
| 34 | { |
| 35 | Rectangle r3, r1, r2; |
| 36 | int temp; |
| 37 | cout << "Rectangle 1" << endl; |
| 38 | cout << "Length: "; |
| 39 | cin >> temp; |
| 40 | r1.setLength(temp); |
| 41 | cout << "Breadth: "; |
| 42 | cin >> temp; |
| 43 | r1.setBreadth(temp); |
| 44 | cout << "Area: " << r1.getArea() << endl |
| 45 | << endl; |
| 46 | |
| 47 | cout << "Rectangle 2" << endl; |
| 48 | cout << "Length: "; |
| 49 | cin >> temp; |
| 50 | r2.setLength(temp); |
| 51 | cout << "Breadth: "; |
| 52 | cin >> temp; |
| 53 | r2.setBreadth(temp); |
| 54 | cout << "Area: " << r2.getArea() << endl |
| 55 | << endl; |
| 56 | |
| 57 | r3 = r1 + r2; // overloading by the binary operator |
| 58 | cout << "Rectangle 3 Area: " << r3.getArea() << endl; |
| 59 | } |
| 60 | |
| 61 | class Distance |
| 62 | { |
no test coverage detected