To actually implement this program, the Shop class was defined to be the primary object on which most of the operations are performed. The Shop class has data members that store all the important information about the Shop, including name, phone, and address, as well as its Menu, and a history of its Orders. Menu is a class itself, and each Menu object contains an integer representing the number of things on the Menu, and a pointer to an array of Coffee objects. An object of the Coffee class represents one single drink (like an Americano) with small, medium, and large prices as data members. An Order class was also defined, which stores information about a single transaction that was made, including the number of drinks and total cost. Many methods were written to help these separate classes interact and ultimately provide the overall desired functionality.
The main focus of this assignment was to learn to implement classes in C++, by creating basic implementations of private data members, public get/set methods, and the "Big 3" (copy constructor, destructor, and assignment overload operator). This assignment required you to use these principles to simulate a Coffee shop, allowing the user to place and log orders, add items to the menu, keep track of revenue, and read and write information to files. The "Big 3" were necessary for the classes that allocate dynamic memory, including the Shop and Menu classes.
This program required a lot of proper planning to ensure the program implemented the classes correctly. I could have saved some time debugging inconsistencies in the output near the end of the project if I had a more thorough plan of how the components would interact, however, from that I learned how to better plan and better understand classes in C++. Furthermore, the dynamic memory allocation for the orders being placed posed an extra challenge as we had to make sure to free the memory and in the proper order, ie child then parent.