| 3 | import box; |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | Box myBox {3.0, 4.0, 5.0}; |
| 8 | std::cout << "myBox dimensions are " << myBox.getLength() |
| 9 | << " by " << myBox.getWidth() |
| 10 | << " by " << myBox.getHeight() << std::endl; |
| 11 | |
| 12 | myBox.setLength(-20.0).setWidth(40.0).setHeight(10.0); // Set all dimensions of myBox |
| 13 | |
| 14 | std::cout << "myBox dimensions are now " << myBox.getLength() // 3 (unchanged) |
| 15 | << " by " << myBox.getWidth() // by 40 |
| 16 | << " by " << myBox.getHeight() << std::endl; // by 10 |
| 17 | } |