Question: C++ Write a C+* class (not a class template) called Inventoryltem. Your class should include: - two private data members: id (an integer) quantity (an

 C++ Write a C+* class (not a class template) called Inventoryltem.

C++

Write a C+* class (not a class template) called Inventoryltem. Your class should include: - two private data members: id (an integer) quantity (an integer) - all member functions should be public. - a default (no argument) constructor that sets id and quantity to zero - an accessor method called getid that has no parameters and retums the value of the id data member. This should be a constant method. - An accessor method called getQuantity that has no parameters and returns the value of the quantity data member. This should be a constant method. - A method called setid that has one integer parameter. This method will store the value of the parameter in the id data memberis incremented by num and the method returns true (update was successful). Otherwise, the object is not modified and the method returns false (invalid request). request). Your class definition should contain only data fields and method prototypes. The implementations for your methods should be putside the class definition. Write you answer in the text box below

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!