| 1 | #include <iostream> |
| 2 | using namespace std; |
| 3 | class Storage |
| 4 | { |
| 5 | public: |
| 6 | class Fruit |
| 7 | { |
| 8 | string name; |
| 9 | int weight; |
| 10 | public: |
| 11 | Fruit(string name="", int weight=0):name(name), weight(weight){} |
| 12 | string getInfo(){return name + ", weight " + to_string(weight) + "kg.";} |
| 13 | }; |
| 14 | private: |
| 15 | Fruit fruit; |
| 16 | public: |
| 17 | Storage(Fruit f) |
| 18 | { |
| 19 | this->fruit = f; |
| 20 | } |
| 21 | void print() |
| 22 | { |
| 23 | cout << fruit.getInfo() << endl; |
| 24 | } |
| 25 | |
| 26 | }; |
| 27 | |
| 28 | int main() |
| 29 | { |
nothing calls this directly
no outgoing calls
no test coverage detected