| 22 | bool Cube::hasLargerVolumeThan(Cube cube) { return volume() > cube.volume(); } |
| 23 | |
| 24 | int main() |
| 25 | { |
| 26 | Cube box1{ 7.0 }; |
| 27 | Cube box2{ 3.0 }; |
| 28 | if (box1.hasLargerVolumeThan(box2)) |
| 29 | std::cout << "box1 is larger than box2." << std::endl; |
| 30 | else |
| 31 | std::cout << "Volume of box1 is less than or equal to that of box2." << std::endl; |
| 32 | |
| 33 | std::cout << "Volume of box1 is " << box1.volume() << std::endl; |
| 34 | if (box1.hasLargerVolumeThan(50.0)) |
| 35 | std::cout << "Volume of box1 is greater than 50" << std::endl; |
| 36 | else |
| 37 | std::cout << "Volume of box1 is less than or equal to 50" << std::endl; |
| 38 | } |
nothing calls this directly
no test coverage detected