Question: C++ code This assignment tests your understanding of concepts covered in the course dealing with classes. For this assignment, you have to create two classes
C++ code


This assignment tests your understanding of concepts covered in the course dealing with classes. For this assignment, you have to create two classes with the corresponding header and implementation files as well as a test file that contains the main function. The Groceryltemorder class should store an item's name, quantity and price per unit. A Groceryltemorder object should have the following functions and any necessary accessors: A constructor that creates an item order to purchase the item with the given name, in the given quantity, which costs the given price per unit. The name must be a cstring. A function that returns the total cost of this item in its given quantity. For example, 4 boxes of cookies that are 2.30 per unit have a cost of 9.20 A function that sets this grocery item's quantity to be the given value. A destructor that deallocates any dynamic memory Test the Groceryltemorder class first before moving onto the next class. Here are the functions that must be implemented in Groceryltemorder class. You don't need to add any more functions. Groceryltemorder(const char nt, float); GroceryltemOrder & operator (const Groceryltemorder&); float getCost0 const, void setQuantity(int); void setltemName(const char void setPrice(float); char getitemName0 const int get Quantity0 consti float getPrice0 const; ~Groceryltemorder The Grocery List represents a person's list of items to buy from the market, and another class named Groceryltemorder that represents a request to purchase a particular item in a given quantity (example: 4 boxes of cookies) The GroceryList class should use an array field to store the grocery items, as well as keeping track of its size (number of items in the list so far). Assume that a grocery list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
