MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / RectangleFirst

Function RectangleFirst

Lab_14/Source.cpp:33–59  ·  view source on GitHub ↗

void function for the inputing data for class 'Rectangle' & uisng the overloading

Source from the content-addressed store, hash-verified

31};
32// void function for the inputing data for class 'Rectangle' & uisng the overloading
33void 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
61class Distance
62{

Callers 1

mainFunction · 0.85

Calls 3

setLengthMethod · 0.80
setBreadthMethod · 0.80
getAreaMethod · 0.45

Tested by

no test coverage detected