Question: C++ Problem 1. a (30 points) You're writing an inventory management system for a chemistry lab. Create a class to represent a container of some
C++

Problem 1. a (30 points) You're writing an inventory management system for a chemistry lab. Create a class to represent a container of some substance (for example, a testtube of acetone). You should include private member variables to store the ID number for the container, the name of the substance, and the amount of the substance (in milliliters), as well as the following member functions: -Two constructors. One that takes no parameters and initializes to default values, and one that takes three parameters to initialize the member variables. -Getters (but NO setters) for the member variables. -Overload += as a member function. This operation will simulate combining the contents of two containers. This operation has the following prerequisite: the names of the substances must match. Please enforce this prerequisite using assert. When adding two containers, you will update the amounts of the two containers to reflect that the contents of the righthand container have been transferred to the lefthand container. b (10 points) Overload the following operators as non-member functions: + This operator has the same prerequisite as +5, which should be enforced. It should simulate adding the contents of both provided containers to a new container. After the operation, both provided containers will be empty. The ID number for the new container should be defined by adding together the ID numbers of the two provided containers. == Two containers are the same if all of their fields match. c (10 points) Write a main function that uses both constructors, at least one getter, and the overloaded +5, +, and ==
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
