A lot of different things end up being stored in a closet, and the attributes that would be used to describe those things vary greatly. You would not use the same variables (or attributes) to describe a sweater that you would use to describe a pair of pants, let alone a soccer ball or that childhood teddy bear that sits in the back corner. Perhaps you even have a magical creature in your closet. (Don't worry I wont report you to the RA.) For this project you are to create a group of classes that describe things that might be in ones closet. Since they have the common feature of being stored in the closet (a lot of them might be clothes, but as I just pointed out there are other things in there as well), there will be a parent class called something like "Closet_item" and then a minimum of five other classes which are children of this class. Were not going to be doing any real calculations using these items, so all they really need are input and output functions, which will need to be virtual in the parent.

You are also to construct, for 10% of your grade, a UML class diagram which describes your classes, but does not need to describe the application. This diagram is to be constructed using Argo UML and should be in the form of a .zargo file, that is included with your project submission.

The application for this project will declare an STL list of pointers of the parent, Closet_item, class which will hold dynamically allocated closet items. The user will be presented with a menu from which they can chose a closet item that they would like to add to the closet. They will then be taken to an input function for that item where they can enter its attributes. Once the customized item is constructed it is put into the list with member push_back function.

The menu should also offer a means to view all the items in the list. Since the list class has no "show_all" function, we will have to rely on the iterator to do this, and note that since we are storing pointers to items instead of the items itself, and since non-member overloaded operators don't work well with this paradigm, the syntax for outputting each thing will look like: (*it)->output(cout);

Finally there is to be a backup file so that a user does not have to reenter everything in their closet every time they start the program. This backup file is to be invisible to the user. The program simply looks for the file, and if it is not found it is assumed that this is the first use of the program by this user, but if it is found the items are put into the list the same way as they were when entered from the keyboard. Following the loading of the list from a file the user is taken to the menu where they can see the stuff that is already listed as being in their closet and add more stuff to the closet. Nothing is ever removed from the closet - which is why it is so full.

Please note: You are NOT writing a container, but are instead using the STL list class. (Available if you just #include < list>) For this project you will really just need the push_back function and the use the iterator, which is bi-directional, but which you will only be using in a forward direction for closet output.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.