| 5 | #include "CerealPack.h" // For the CerealPack class |
| 6 | |
| 7 | int main() |
| 8 | { |
| 9 | CerealPack cornflakes{ 8.0, 3.0, 10.0, "Cornflakes" }; |
| 10 | |
| 11 | std::cout << "cornflakes volume is " << cornflakes.volume() << std::endl |
| 12 | << "cornflakes weight is " << cornflakes.getWeight() << std::endl; |
| 13 | /* |
| 14 | // Here is one way to make this work (see Ex14_07A and B for alternatives) |
| 15 | std::cout << "cornflakes volume is " << cornflakes.Carton::volume() << std::endl |
| 16 | << "cornflakes weight is " << cornflakes.FoodContainer::getWeight() |
| 17 | << std::endl; |
| 18 | */ |
| 19 | } |