Inventory with multiset
hardQuestion 477Build a class Inventory that stores item names in a multiset<string>, so the same name can be held several times. Public methods:
1. void add(const string& name): adds one copy.
2. bool removeOne(const string& name): removes exactly ONE copy and returns true; if the item is absent, returns false and changes nothing.
3. int count(const string& name) const: how many copies are stored (0 if none).
4. void print() const: one line per distinct item in alphabetical order, as apple x2 (name, space, x, count). An empty inventory prints the single line (empty).
The test prints true/false for each removeOne and the number from count. For add apple, pear, apple; print(); removeOne("apple"); removeOne("kiwi"); print() (see Expected Output).
Do NOT write a main function.
Expected output
apple x2 pear x1 true false apple x1 pear x1 2 true true 0 false (empty)
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...