| 3 | #include "Carton.h" |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | // Declare and initialize a Carton object |
| 8 | Carton carton{ 20.0, 30.0, 40.0, "Expanded polystyrene" }; |
| 9 | std::cout << std::endl; |
| 10 | |
| 11 | Carton cartonCopy{ carton }; // Use copy constructor |
| 12 | std::cout << std::endl; |
| 13 | |
| 14 | std::cout << "Volume of carton is " << carton.volume() << std::endl |
| 15 | << "Volume of cartonCopy is " << cartonCopy.volume() << std::endl; |
| 16 | } |