Question: I need help with my CPSC131 Project. Below is the description and requirement of the project. 1. A class named Groceryltem. You will reuse this

I need help with my CPSC131 Project. Below is the description and requirement of the project.

I need help with my CPSC131 Project. Below is the description and

requirement of the project. 1. A class named Groceryltem. You will reuse

this class in future homework assignments, so effort you apply getting it

1. A class named Groceryltem. You will reuse this class in future homework assignments, so effort you apply getting it right now will greatly benefit you later. a. Attributes i. Product Name the name of the product (Ex: Heinz Tomato Ketchup - 2 Ct, Boston Market Spaghetti With Meatballs) ii. Brand Name - the product manufacture's brand name (Ex: Heinz, Boston Market) iii. UPC - a 14-digit Universal Product Code uniquely identifying this item (Ex: 00051600080015, 05017402006207). Code this as a string type, not an integral type. iv. Price - the cost of the item in US Dollars (Ex: 2.29, 1.19). Code this as type double. b. Construction i. Allow grocery items to be constructed with zero, one, two, three, or four arguments?. The first argument must be the product name, the second the brand name, the third the UPC, and the fourth the price. ii. Initialize each attribute with member initialization? and in the constructor's initialization list3. Do not set the attribute's value in the body of the constructor. C. Operations i. Set and retrieve each of the attributes. Name your overloaded functions upcCode, brandName, productName, and price. For example: void upcCode ( const std::string & upcCode); //mutate std::string upcCode () const; //query ii. Overload the insertion and extraction operators. For example, main() may read from standard input and write to standard output a Groceryltem object like this: GroceryItem groceryItem; std::cin >> groceryItem; // extraction (reading) std::cout > groceryItem; // extraction (reading) std::cout

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!